/*
 * Thème madus — shell minimaliste (hôte de l'app Dossiers). FRONT uniquement.
 * Charte maquette. La mise en forme des écrans vient des CSS du module.
 *
 * ⚠️ La coquille du BO en mode client est un AUTRE fichier :
 * modules/madusbotheme/views/css/client-shell.css (mêmes classes .madus-*,
 * mais tout y est scopé body.madus-client). Ne pas corriger l'un pour l'autre.
 */
:root {
  --red-600:#D81F2A; --red-700:#B3161F;
  --ink:#1C1F26; --slate-500:#6B7280; --slate-400:#9AA1AD;
  --border:#E7E9EE; --bg:#F4F5F7; --surface:#FFFFFF;
  --sidebar:#1C1F26;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.madus-app {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* ---- Layout ---- */
.madus-layout { display: flex; min-height: 100vh; }

/* Scrollbar fine (charte maquette). */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d7dae1; border-radius: 99px; border: 2px solid #f4f5f7; }
::-webkit-scrollbar-track { background: transparent; }
.madus-main { flex: 1; min-width: 0; }

/* ---- Sidebar ---- */
.madus-sidebar {
  width: 287px; flex: none; background: var(--sidebar); color: #fff;
  display: flex; flex-direction: column; padding: 18px 14px;
  position: sticky; top: 0; height: 100vh;
  /* Sans border-box, height:100vh + les 2×18px de padding font déborder le
     pied (Sign out) sous la fenêtre. */
  box-sizing: border-box;
}
.madus-sidebar__logo {
  display: inline-flex; flex-direction: column; line-height: .9;
  text-decoration: none; padding: 4px 10px 22px;
}
.madus-sidebar__logo b { font-weight: 800; font-size: 39px; letter-spacing: -.04em; color: #fff; }
.madus-sidebar__logo span { font-size: 13.5px; letter-spacing: .42em; text-transform: uppercase; color: rgba(255,255,255,.7); padding-left: 2px; margin-top: 3px; }

/* Topbar (recherche + actions + notifications), charte maquette. */
.madus-topbar {
  height: 60px; flex: none; display: flex; align-items: center; gap: 16px;
  padding: 0 28px; background: #fff; border-bottom: 1px solid #eceff3;
  position: sticky; top: 0; z-index: 20;
}
.madus-topbar__search {
  flex: 1; max-width: 460px; display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 14px; background: #f6f8fb;
  border: 1px solid transparent; border-radius: 999px; color: #667085;
  transition: border-color .15s, background .15s;
}
.madus-topbar__search:focus-within { background: #fff; border-color: #eceff3; }
.madus-topbar__search input { border: none; background: none; outline: none; width: 100%; font: inherit; font-size: 13.5px; color: #1C1F26; }
.madus-topbar__search svg { width: 18px; height: 18px; flex: none; }
.madus-topbar .madus-btn--primary { margin-left: auto; }
.madus-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 999px; font-weight: 600; font-size: 13.5px; border: none; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.madus-btn svg { width: 18px; height: 18px; }
.madus-btn--primary { background: #e4333d; color: #fff; }
.madus-btn--primary:hover { background: #c92a33; }
.madus-iconbtn {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: 999px; border: 1px solid transparent; background: none; color: #667085; cursor: pointer;
}
.madus-iconbtn:hover { background: #f6f8fb; color: #1C1F26; }
.madus-iconbtn svg { width: 18px; height: 18px; }
/* min-height:0 + overflow : si le menu devient plus haut que l'écran, c'est LUI
   qui scrolle — le pied (Ma boutique / profil / Sign out) reste toujours visible. */
.madus-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0; overflow-y: auto; }
.madus-nav__group {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.38); padding: 14px 12px 6px;
}
.madus-nav__link {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,.78); text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 10px 12px; border-radius: 10px; transition: background .15s, color .15s;
}
.madus-nav__link:hover { background: rgba(255,255,255,.08); color: #fff; }
.madus-nav__link.is-active { background: var(--red-600); color: #fff; }
.madus-nav__ico { display: inline-flex; flex: none; width: 18px; height: 18px; }
.madus-nav__ico svg { width: 18px; height: 18px; }
.madus-nav__txt { flex: 1; min-width: 0; }
.madus-nav__link.is-soon { color: rgba(255,255,255,.4); cursor: default; }
.madus-nav__link.is-soon:hover { background: transparent; color: rgba(255,255,255,.4); }
.madus-nav__link.is-locked { color: rgba(255,255,255,.62); }
.madus-nav__link.is-locked:hover { color: #fff; background: rgba(255,255,255,.06); }
.madus-nav__badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: rgba(255,255,255,.12); color: rgba(255,255,255,.7);
  padding: 2px 6px; border-radius: 999px;
}
.madus-nav__badge--lock { background: rgba(224,148,27,.95); color: #fff; }
.madus-sidebar__foot {
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.madus-me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; text-decoration: none; transition: background .15s; }
.madus-me:hover { background: rgba(255,255,255,.08); }
.madus-me__avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: #D81F2A; color: #fff; font-weight: 700; font-size: 12.5px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.madus-me__meta { font-size: 12.5px; line-height: 1.25; color: #fff; flex: 1; min-width: 0; overflow: hidden; }
.madus-me__meta small { color: rgba(255,255,255,.5); }
.madus-me__gear { width: 16px; height: 16px; color: rgba(255,255,255,.5); flex: none; }
.madus-sidebar__logout { font-size: 12px; color: rgba(255,255,255,.55); text-decoration: none; padding: 2px 8px; cursor: pointer; }
.madus-sidebar__logout:hover { color: #fff; }

/* ---- Mini-modale de confirmation (déconnexion) ---- */
.madus-confirm[hidden] { display: none; }
.madus-confirm {
  position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center;
  padding: 24px; background: rgba(16,24,40,.5);
}
.madus-confirm__box {
  width: min(380px, 100%); background: #fff; border-radius: 16px;
  box-shadow: 0 18px 48px rgba(16,24,40,.3); padding: 24px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: #1C1F26;
}
.madus-confirm__title { font-size: 17px; font-weight: 800; margin: 0 0 6px; }
.madus-confirm__msg { font-size: 14px; color: #6B7280; margin: 0 0 20px; line-height: 1.45; }
.madus-confirm__actions { display: flex; gap: 10px; justify-content: flex-end; }
.madus-confirm__btn {
  height: 40px; padding: 0 18px; border-radius: 10px; font: inherit; font-weight: 600; font-size: 13.5px;
  cursor: pointer; border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.madus-confirm__btn--ghost { background: #fff; color: #3A4150; border-color: #E7E9EE; }
.madus-confirm__btn--ghost:hover { border-color: #9AA1AD; }
.madus-confirm__btn--primary { background: #D81F2A; color: #fff; }
.madus-confirm__btn--primary:hover { background: #B3161F; }

/* ---- Alertes ---- */
.madus-alert { margin: 16px 18px 0; padding: 12px 16px; border-radius: 10px; font-size: 14px; }
.madus-alert--error { background: #FDECEC; color: #B3161F; }
.madus-alert--ok { background: #E6F7EF; color: #0E9E83; }
.madus-alert ul { margin: 0; padding-left: 18px; }

/* ---- Vide / 404 ---- */
.madus-empty { padding: 60px 24px; text-align: center; color: var(--slate-500); }
.madus-empty h1 { font-size: 48px; font-weight: 800; margin: 0 0 8px; }

/* ---- Connexion ---- */
.madus-layout--auth { background: var(--bg); }
.madus-main--auth { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.madus-auth {
  width: min(420px, 100%); background: var(--surface); border-radius: 18px;
  box-shadow: 0 18px 48px rgba(16,24,40,.12); overflow: hidden;
}
.madus-auth__brand { background: var(--sidebar); color: #fff; padding: 30px 28px; text-align: center; }
.madus-auth__logo { font-weight: 800; font-size: 28px; letter-spacing: .05em; }
.madus-auth__tagline { color: rgba(255,255,255,.7); font-size: 13px; margin: 6px 0 0; }
.madus-auth__form { padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.madus-auth__form h1 { font-size: 20px; font-weight: 800; margin: 0; }
.madus-field label { font-size: 12px; font-weight: 700; color: var(--slate-500); display: block; margin-bottom: 6px; }
.madus-field input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: 10px; font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
}
.madus-field input:focus { outline: none; border-color: var(--red-600); }
.madus-remember { font-size: 13px; color: var(--slate-500); display: flex; align-items: center; gap: 8px; }
.madus-auth__btn {
  height: 44px; background: var(--red-600); color: #fff; border: none; border-radius: 10px;
  font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; transition: background .15s;
}
.madus-auth__btn:hover { background: var(--red-700); }

/* ---- Bandeau démonstration (lot 6) ----
   Sur fond sombre de sidebar. Discret tant que l'échéance est loin, franchement rouge dans
   la dernière semaine : la purge est irréversible, l'avertissement doit se voir avant. */
.madus-demo {
  margin: 10px 0; padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
}
.madus-demo__title {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.55); margin-bottom: 4px;
}
.madus-demo__count { font-size: 13px; color: #fff; line-height: 1.3; }
.madus-demo__count strong { font-size: 16px; font-weight: 700; }
.madus-demo__warn { margin-top: 6px; font-size: 11px; line-height: 1.35; color: rgba(255,255,255,.5); }
.madus-demo--urgent {
  background: rgba(216,31,42,.18); border-color: var(--red-600);
}
.madus-demo--urgent .madus-demo__title { color: #ff9ba1; }
.madus-demo--urgent .madus-demo__warn { color: rgba(255,255,255,.72); }

@media (max-width: 760px) {
  .madus-layout { flex-direction: column; }
  .madus-sidebar {
    width: 100%; height: auto; position: static; flex-direction: row;
    align-items: center; gap: 12px; padding: 10px 14px;
  }
  .madus-sidebar__logo { padding: 0 6px; }
  .madus-nav { flex-direction: row; flex: 1; gap: 2px; }
  .madus-nav__group { display: none; }
  .madus-nav__badge { display: none; }
  .madus-sidebar__foot { border: none; padding: 0; flex-direction: row; align-items: center; gap: 10px; }
  /* La sidebar devient une barre : le bandeau se réduit au décompte, sinon il casse la ligne.
     L'avertissement de purge disparaît ici — il reste sur l'écran Abonnement. */
  .madus-demo { margin: 0; padding: 6px 10px; flex: none; }
  .madus-demo__warn { display: none; }
  .madus-demo__count { font-size: 12px; white-space: nowrap; }
  .madus-demo__count strong { font-size: 13px; }
}
