/* ==========================================================================
   Lui — CRM  ·  feuille de style unique
   ========================================================================== */

:root{
  --brand:#4f46e5;
  --brand-2:#7c3aed;
  --brand-soft:#eef0ff;
  --accent:#06b6d4;
  --ink:#0f172a;
  --ink-2:#334155;
  --muted:#64748b;
  --muted-2:#94a3b8;
  --line:#e6eaf2;
  --line-2:#eef1f7;
  --bg:#f4f6fb;
  --surface:#ffffff;
  --side:#101527;
  --side-2:#171d33;
  --ok:#10b981;
  --ok-soft:#e7f8f1;
  --warn:#f59e0b;
  --warn-soft:#fef4e2;
  --danger:#ef4444;
  --danger-soft:#fdecec;
  --info:#3b82f6;
  --radius:16px;
  --radius-sm:10px;
  --radius-lg:22px;
  --shadow:0 1px 2px rgba(15,23,42,.05), 0 8px 24px -12px rgba(15,23,42,.14);
  --shadow-lg:0 20px 50px -20px rgba(15,23,42,.35);
  --side-w:250px;
  --font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  --font-display:'Plus Jakarta Sans','Inter',-apple-system,sans-serif;
}

*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none !important}

html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  font-family:var(--font);
  background:var(--bg);
  color:var(--ink);
  font-size:15px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{font-family:var(--font-display);margin:0;line-height:1.25;letter-spacing:-.02em;font-weight:700}
h1{font-size:1.5rem}
h2{font-size:1.2rem}
h3{font-size:1.02rem}
h4{font-size:.92rem}
p{margin:0}
a{color:var(--brand);text-decoration:none}
img{max-width:100%;display:block}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px}

/* ---------- utilitaires ---------- */
.muted{color:var(--muted)}
.small{font-size:.8rem}
.tiny{font-size:.72rem}
.bold{font-weight:600}
.center{text-align:center}
.right{text-align:right}
.mt-8{margin-top:8px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}
.mb-8{margin-bottom:8px}.mb-16{margin-bottom:16px}.mb-24{margin-bottom:24px}
.gap-8{gap:8px}.gap-16{gap:16px}
.row{display:flex;align-items:center;gap:10px}
.row.between{justify-content:space-between}
.row.wrap{flex-wrap:wrap}
.spacer{flex:1}
.stack{display:flex;flex-direction:column;gap:12px}
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.up{text-transform:uppercase;letter-spacing:.08em;font-size:.68rem;font-weight:700;color:var(--muted)}
.only-mob{display:block}
.only-desk{display:none}
@media (min-width:768px){
  .only-mob{display:none}
  .only-desk{display:block}
}

/* ==========================================================================
   CONNEXION
   ========================================================================== */
.auth{
  min-height:100dvh;
  display:grid;
  grid-template-columns:1fr;
  background:var(--bg);
}
.auth-visual{
  display:none;
  position:relative;
  overflow:hidden;
  background:
    radial-gradient(900px 500px at 80% 10%, rgba(124,58,237,.55), transparent 60%),
    linear-gradient(150deg,#151a30 0%,#0d1122 60%,#1a1038 100%);
  color:#fff;
  padding:44px;
  flex-direction:column;
  justify-content:space-between;
}
.auth-visual::after{
  content:"";position:absolute;inset:0;
  background-image:linear-gradient(rgba(255,255,255,.045) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.045) 1px,transparent 1px);
  background-size:44px 44px;
  mask-image:radial-gradient(circle at 30% 20%,#000,transparent 78%);
}
.auth-visual>*{position:relative;z-index:1}
.auth-visual h2{font-size:2rem;max-width:22ch}
.auth-quote{max-width:34ch;color:rgba(255,255,255,.72)}
.auth-points{display:flex;flex-direction:column;gap:12px;margin-top:26px}
.auth-points div{display:flex;gap:12px;align-items:flex-start;color:rgba(255,255,255,.9);font-size:.9rem}
.auth-points svg{flex:0 0 20px;margin-top:2px;color:#a5b4fc}
.auth-panel{
  display:flex;align-items:center;justify-content:center;
  padding:calc(28px + env(safe-area-inset-top,0px)) 20px calc(28px + env(safe-area-inset-bottom,0px));
}
.auth-card{width:100%;max-width:410px}
.brand{display:flex;align-items:center;gap:11px;font-family:var(--font-display);font-weight:800;font-size:1.15rem;letter-spacing:-.03em}
.brand-mark{
  width:40px;height:40px;border-radius:12px;flex:0 0 40px;
  background:linear-gradient(140deg,var(--brand),var(--brand-2));
  display:grid;place-items:center;color:#fff;font-weight:800;font-size:1.05rem;
  box-shadow:0 8px 20px -8px rgba(79,70,229,.8);
}
.brand-mark.light{background:linear-gradient(140deg,#8b93ff,#a78bfa)}
.brand-mark.admin{background:linear-gradient(140deg,#0f766e,#0891b2);box-shadow:0 8px 20px -8px rgba(8,145,178,.75)}
.tabbar.t4{grid-template-columns:repeat(4,1fr)}
.admin-badge{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:20px;background:#e6fbf7;color:#0f766e;font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em}
.auth-card .brand{margin-bottom:26px}
.auth-card h1{margin-bottom:6px}
.field{margin-bottom:14px}
.field label{display:block;font-size:.8rem;font-weight:600;color:var(--ink-2);margin-bottom:6px}
.input,.select,.textarea{
  width:100%;
  padding:11px 13px;
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  background:#fff;
  transition:.18s border-color,.18s box-shadow;
}
.input:focus,.select:focus,.textarea:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 4px rgba(79,70,229,.12)}
.textarea{min-height:92px;resize:vertical}
.select{appearance:none;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");background-repeat:no-repeat;background-position:right 11px center;padding-right:34px}
.alert{padding:11px 13px;border-radius:var(--radius-sm);font-size:.85rem;margin-bottom:14px;display:none}
.alert.show{display:block}
.alert.error{background:var(--danger-soft);color:#b91c1c}
.alert.success{background:var(--ok-soft);color:#047857}
.auth-foot{margin-top:22px;padding-top:18px;border-top:1px solid var(--line);color:var(--muted-2);font-size:.78rem;display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}

.install-strip{
  margin-top:20px;border:1px dashed var(--line);border-radius:var(--radius-sm);
  padding:12px 13px;display:flex;gap:10px;align-items:center;background:#fbfcff;
}
.install-strip .ico{width:34px;height:34px;border-radius:9px;background:var(--brand-soft);display:grid;place-items:center;color:var(--brand);flex:0 0 34px}
.install-strip p{font-size:.78rem;color:var(--muted)}

/* ==========================================================================
   BOUTONS
   ========================================================================== */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:10px 16px;border-radius:var(--radius-sm);border:1px solid transparent;
  background:var(--brand);color:#fff;font-weight:600;font-size:.88rem;
  cursor:pointer;transition:.16s transform,.16s box-shadow,.16s background;
  white-space:nowrap;
}
.btn:hover:not(:disabled){transform:translateY(-1px)}
.btn:active:not(:disabled){transform:translateY(0)}
.btn:disabled{opacity:.55;cursor:not-allowed}
.btn svg{width:17px;height:17px}
.btn-primary{background:linear-gradient(135deg,var(--brand),var(--brand-2));box-shadow:0 10px 22px -12px rgba(79,70,229,.9)}
.btn-dark{background:var(--ink)}
.btn-ghost{background:#fff;border-color:var(--line);color:var(--ink-2)}
.btn-ghost:hover{background:#fafbff;border-color:#d8dfee}
.btn-soft{background:var(--brand-soft);color:var(--brand)}
.btn-danger{background:var(--danger-soft);color:#b91c1c}
.btn-ok{background:var(--ok-soft);color:#047857}
.btn-sm{padding:7px 12px;font-size:.8rem}
.btn-block{width:100%}
.btn-icon{padding:9px;border-radius:10px;background:#fff;border:1px solid var(--line);color:var(--ink-2);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:.16s}
.btn-icon:hover{background:#fafbff;color:var(--brand)}
.btn-icon svg{width:18px;height:18px}
.btn-icon.danger:hover{background:var(--danger-soft);color:#b91c1c}

/* ==========================================================================
   COQUILLE D'APPLICATION
   ========================================================================== */
.shell{display:grid;grid-template-columns:1fr;min-height:100dvh}
.side{
  display:none;
  background:linear-gradient(185deg,var(--side) 0%,#0c1020 100%);
  color:#c7cede;padding:20px 16px;
  position:sticky;top:0;height:100dvh;
  flex-direction:column;gap:6px;
}
.side .brand{color:#fff;padding:4px 6px 20px}
.side-nav{display:flex;flex-direction:column;gap:3px;flex:1;overflow-y:auto}
.side-link{
  display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:11px;
  color:#9aa4bd;font-weight:500;font-size:.9rem;transition:.16s;position:relative;
}
.side-link svg{width:19px;height:19px;flex:0 0 19px}
.side-link:hover{background:rgba(255,255,255,.06);color:#fff}
.side-link.active{background:linear-gradient(100deg,rgba(79,70,229,.9),rgba(124,58,237,.65));color:#fff;box-shadow:0 10px 24px -14px rgba(79,70,229,1)}
.side-link .pill{margin-left:auto;background:rgba(255,255,255,.16);border-radius:20px;padding:1px 8px;font-size:.7rem}
.side-foot{border-top:1px solid rgba(255,255,255,.09);padding-top:14px;margin-top:10px}
.side-user{display:flex;align-items:center;gap:10px}
.side-user .meta{min-width:0}
.side-user .meta b{display:block;color:#fff;font-size:.84rem;font-weight:600}
.side-user .meta span{font-size:.72rem;color:#8b95ad}
.side-label{padding:14px 12px 6px;color:#5f6a86;font-size:.68rem;text-transform:uppercase;letter-spacing:.09em;font-weight:700}
.side-note{font-size:.72rem;color:#6b7691;padding:8px 12px 0;line-height:1.5}

.main{padding:0 0 calc(84px + env(safe-area-inset-bottom,0px));min-width:0}
.topbar{
  background:rgba(255,255,255,.92);backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
  padding:calc(12px + env(safe-area-inset-top,0px)) 16px 12px;
  position:sticky;top:0;z-index:40;
  display:flex;align-items:center;gap:12px;
}
.topbar h1{font-size:1.1rem}
.topbar .sub{font-size:.75rem;color:var(--muted)}
.topbar-actions{margin-left:auto;display:flex;align-items:center;gap:8px}
.content{padding:18px 16px}
.page-head{display:flex;flex-direction:column;gap:12px;margin-bottom:18px}
.page-head .actions{display:flex;gap:8px;flex-wrap:wrap}
.searchbox{position:relative;flex:1;min-width:0}
.searchbox svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:17px;height:17px;color:var(--muted-2)}
.searchbox .input{padding-left:38px}

/* ---------- barre de navigation basse (mobile) ---------- */
.tabbar{
  position:fixed;left:0;right:0;bottom:0;z-index:60;
  background:rgba(255,255,255,.97);backdrop-filter:blur(12px);
  border-top:1px solid var(--line);
  display:grid;grid-template-columns:repeat(5,1fr);
  padding-bottom:env(safe-area-inset-bottom,0px);
}
.tabbar a{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  padding:9px 2px 8px;color:var(--muted);font-size:.65rem;font-weight:600;transition:.16s;
}
.tabbar a svg{width:21px;height:21px}
.tabbar a.active{color:var(--brand)}
.tabbar a.active svg{transform:translateY(-1px)}

/* ==========================================================================
   CARTES & STATS
   ========================================================================== */
.card{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow);overflow:hidden;
}
.card-head{padding:16px 18px;border-bottom:1px solid var(--line-2);display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.card-head h3{font-size:.98rem}
.card-head .sub{font-size:.75rem;color:var(--muted);font-weight:400}
.card-body{padding:18px}
.card-body.tight{padding:0}

.stats{display:grid;grid-template-columns:1fr;gap:12px}
.stat{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  padding:16px;box-shadow:var(--shadow);position:relative;overflow:hidden;
}
.stat .ico{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;margin-bottom:12px}
.stat .ico svg{width:20px;height:20px}
.stat .label{font-size:.76rem;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.05em}
.stat .value{font-family:var(--font-display);font-size:1.65rem;font-weight:800;letter-spacing:-.03em;margin-top:2px}
.stat .delta{font-size:.76rem;color:var(--muted);margin-top:4px}
.stat .delta b{color:var(--ok)}
.ico-brand{background:var(--brand-soft);color:var(--brand)}
.ico-ok{background:var(--ok-soft);color:#047857}
.ico-warn{background:var(--warn-soft);color:#b45309}
.ico-info{background:#e8f1ff;color:#1d4ed8}
.ico-danger{background:var(--danger-soft);color:#b91c1c}

.progress{height:7px;border-radius:20px;background:var(--line);overflow:hidden}
.progress span{display:block;height:100%;border-radius:20px;background:linear-gradient(90deg,var(--brand),var(--brand-2))}

/* ==========================================================================
   AVATARS / BADGES
   ========================================================================== */
.avatar{width:38px;height:38px;border-radius:50%;object-fit:cover;flex:0 0 38px;background:var(--brand-soft)}
.avatar.sm{width:30px;height:30px;flex:0 0 30px}
.avatar.lg{width:64px;height:64px;flex:0 0 64px}
.avatar.xl{width:84px;height:84px;flex:0 0 84px}
.badge{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:20px;font-size:.7rem;font-weight:700;letter-spacing:.01em}
.badge.gray{background:var(--line-2);color:var(--muted)}
.badge.brand{background:var(--brand-soft);color:var(--brand)}
.badge.ok{background:var(--ok-soft);color:#047857}
.badge.warn{background:var(--warn-soft);color:#b45309}
.badge.info{background:#e8f1ff;color:#1d4ed8}
.badge.danger{background:var(--danger-soft);color:#b91c1c}
.tag{display:inline-block;padding:2px 8px;border-radius:7px;background:var(--line-2);color:var(--ink-2);font-size:.68rem;font-weight:600;margin:2px 3px 2px 0}

/* ==========================================================================
   TABLEAUX
   ========================================================================== */
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
table.tbl{width:100%;border-collapse:collapse;min-width:640px}
.tbl th{
  text-align:left;padding:11px 16px;background:#fbfcff;border-bottom:1px solid var(--line);
  font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:700;white-space:nowrap;
}
.tbl td{padding:12px 16px;border-bottom:1px solid var(--line-2);vertical-align:middle;font-size:.87rem}
.tbl tr:last-child td{border-bottom:none}
.tbl tbody tr{transition:background .14s}
.tbl tbody tr:hover{background:#fafbff}
.cell-user{display:flex;align-items:center;gap:11px;min-width:190px}
.cell-user b{display:block;font-size:.88rem;font-weight:600}
.cell-user span{font-size:.75rem;color:var(--muted)}

/* cartes-liste (mobile) */
.list-cards{display:flex;flex-direction:column}
.list-item{padding:14px 16px;border-bottom:1px solid var(--line-2);display:flex;gap:12px;align-items:center}
.list-item:last-child{border-bottom:none}

.pager{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px;flex-wrap:wrap}
.pager .pages{display:flex;gap:6px;flex-wrap:wrap}
.pager button{
  min-width:34px;height:34px;border-radius:9px;border:1px solid var(--line);background:#fff;
  cursor:pointer;font-size:.82rem;font-weight:600;color:var(--ink-2);
}
.pager button.active{background:var(--brand);border-color:var(--brand);color:#fff}
.pager button:disabled{opacity:.45;cursor:not-allowed}

.empty{padding:46px 20px;text-align:center;color:var(--muted)}
.empty svg{width:44px;height:44px;color:var(--muted-2);margin-bottom:12px}
.empty h3{margin-bottom:4px;color:var(--ink)}

/* ==========================================================================
   PIPELINE (kanban)
   ========================================================================== */
.board{display:grid;grid-template-columns:1fr;gap:14px;align-items:start}
.col{
  background:#eef1f8;border:1px solid var(--line);border-radius:var(--radius);
  display:flex;flex-direction:column;min-height:120px;transition:.18s;
}
.col.dragover{border-color:var(--brand);background:var(--brand-soft);box-shadow:0 0 0 3px rgba(79,70,229,.14)}
.col-head{padding:13px 14px 11px;display:flex;align-items:center;gap:9px;border-bottom:1px solid rgba(15,23,42,.06)}
.col-head .dot{width:9px;height:9px;border-radius:50%;flex:0 0 9px}
.col-head b{font-size:.83rem;font-weight:700;font-family:var(--font-display)}
.col-head .n{margin-left:auto;background:#fff;border-radius:20px;padding:1px 8px;font-size:.7rem;font-weight:700;color:var(--muted)}
.col-sum{padding:9px 14px;font-size:.74rem;color:var(--muted);border-bottom:1px solid rgba(15,23,42,.06);font-weight:600}
.col-body{padding:10px;display:flex;flex-direction:column;gap:9px;flex:1;overflow-y:auto;max-height:64vh}
.deal{
  background:#fff;border:1px solid var(--line);border-radius:13px;padding:12px;
  box-shadow:0 1px 2px rgba(15,23,42,.05);cursor:grab;transition:.16s;
}
.deal:hover{box-shadow:var(--shadow);transform:translateY(-1px)}
.deal.dragging{opacity:.45;cursor:grabbing}
.deal-head{display:flex;align-items:center;gap:9px;margin-bottom:9px}
.deal-head .nm{min-width:0;flex:1}
.deal-head b{display:block;font-size:.86rem;font-weight:600}
.deal-head span{font-size:.72rem;color:var(--muted);display:block}
.deal-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:.78rem}
.deal-meta .amt{font-weight:700;color:var(--ink);font-family:var(--font-display)}
.col-body.dz{min-height:70px}

/* poignée de glisser-déposer */
.deal-head .grip{margin-left:auto;background:none;border:none;padding:3px;color:var(--muted-2);cursor:grab;touch-action:none;display:inline-flex;align-items:center;justify-content:center;border-radius:7px;flex:0 0 auto}
.deal-head .grip svg{width:16px;height:16px}
.deal-head .grip:hover{background:var(--line-2);color:var(--ink-2)}
.drag-ghost{position:fixed;z-index:300;pointer-events:none;width:228px;transform:rotate(2deg) scale(1.03);box-shadow:var(--shadow-lg);opacity:.96;border-radius:13px;background:#fff;border:1px solid var(--brand);padding:12px}
body.dragging{user-select:none}
body.dragging *{cursor:grabbing !important}
.board-hint{font-size:.76rem;color:var(--muted);display:flex;align-items:center;gap:7px;margin-bottom:12px}
.board-hint svg{width:15px;height:15px}

.stage-dot{background:#94a3b8}
.s-nouveau{background:#94a3b8}
.s-contacte{background:#3b82f6}
.s-qualifie{background:#06b6d4}
.s-proposition{background:#f59e0b}
.s-negociation{background:#a855f7}
.s-gagne{background:#10b981}

/* ==========================================================================
   CALENDRIER / AGENDA
   ========================================================================== */
.cal-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.cal-head .nav{display:flex;gap:6px;align-items:center}
.cal-title{font-family:var(--font-display);font-weight:700;font-size:1rem;min-width:150px}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.cal-dow{text-align:center;font-size:.68rem;font-weight:700;color:var(--muted);text-transform:uppercase;padding:6px 0}
.cal-day{
  min-height:74px;border:1px solid var(--line-2);border-radius:10px;padding:6px;background:#fff;
  display:flex;flex-direction:column;gap:3px;cursor:pointer;transition:.14s;
}
.cal-day:hover{border-color:#c9d2e6;background:#fafbff}
.cal-day.out{background:#fafbfe;color:var(--muted-2)}
.cal-day.today{border-color:var(--brand);box-shadow:0 0 0 3px rgba(79,70,229,.1)}
.cal-day .d{font-size:.74rem;font-weight:700;color:var(--ink-2)}
.cal-day.out .d{color:var(--muted-2)}
.cal-day.today .d{color:var(--brand)}
.cal-ev{font-size:.62rem;font-weight:600;border-radius:5px;padding:2px 5px;background:var(--brand-soft);color:var(--brand);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cal-ev.t-fait{background:var(--ok-soft);color:#047857}
.cal-ev.t-annule{background:var(--line-2);color:var(--muted);text-decoration:line-through}
.agenda-list{display:flex;flex-direction:column;gap:10px}
.agenda-item{
  display:flex;gap:12px;padding:12px;border:1px solid var(--line);border-radius:13px;background:#fff;transition:.15s;
}
.agenda-item:hover{box-shadow:var(--shadow)}
.agenda-time{flex:0 0 62px;font-size:.78rem;font-weight:700;color:var(--ink-2);font-family:var(--font-display)}
.agenda-item .t{font-size:.88rem;font-weight:600}
.agenda-item .s{font-size:.76rem;color:var(--muted)}

.todo{display:flex;gap:11px;align-items:flex-start;padding:12px 14px;border-bottom:1px solid var(--line-2)}
.todo:last-child{border-bottom:none}
.todo .box{
  width:20px;height:20px;border-radius:6px;border:2px solid #cbd5e1;flex:0 0 20px;margin-top:1px;
  cursor:pointer;display:grid;place-items:center;transition:.15s;background:#fff;
}
.todo .box svg{width:13px;height:13px;color:#fff;opacity:0}
.todo.done .box{background:var(--ok);border-color:var(--ok)}
.todo.done .box svg{opacity:1}
.todo.done .t{text-decoration:line-through;color:var(--muted)}
.todo .t{font-size:.87rem;font-weight:500}
.todo .s{font-size:.74rem;color:var(--muted)}
.prio{width:3px;border-radius:3px;align-self:stretch;flex:0 0 3px}
.p-haute{background:var(--danger)}
.p-normale{background:var(--warn)}
.p-basse{background:var(--muted-2)}

/* ==========================================================================
   GRAPHIQUES
   ========================================================================== */
.chart-box{position:relative;height:270px;width:100%}
.chart-box.sm{height:210px}
.legend{display:flex;flex-direction:column;gap:9px}
.legend-row{display:flex;align-items:center;gap:10px;font-size:.83rem}
.legend-row .sw{width:11px;height:11px;border-radius:4px;flex:0 0 11px}
.legend-row .v{margin-left:auto;font-weight:700;font-family:var(--font-display)}
.legend-row .en{color:var(--muted);font-size:.76rem}

.bars{display:flex;flex-direction:column;gap:11px}
.bar-row .lbl{display:flex;justify-content:space-between;font-size:.79rem;margin-bottom:5px}
.bar-row .lbl b{font-family:var(--font-display)}

/* ==========================================================================
   MODALES / TIROIR
   ========================================================================== */
.overlay{
  position:fixed;inset:0;background:rgba(15,23,42,.5);backdrop-filter:blur(3px);
  z-index:100;display:none;align-items:flex-end;justify-content:center;padding:0;
}
.overlay.open{display:flex}
.modal{
  background:#fff;width:100%;max-width:560px;max-height:92dvh;border-radius:20px 20px 0 0;
  display:flex;flex-direction:column;box-shadow:var(--shadow-lg);
  animation:slideUp .22s ease;
}
@keyframes slideUp{from{transform:translateY(24px);opacity:.6}to{transform:translateY(0);opacity:1}}
.modal-head{padding:16px 18px calc(14px);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:12px;position:sticky;top:0;background:#fff;border-radius:20px 20px 0 0;z-index:2}
.modal-head h3{flex:1}
.modal-body{padding:18px;overflow-y:auto;flex:1}
.modal-foot{padding:14px 18px calc(14px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--line);display:flex;gap:10px;background:#fbfcff}
.modal-foot .btn{flex:1}
.form-grid{display:grid;grid-template-columns:1fr;gap:0 14px}
.form-grid .full{grid-column:1/-1}

/* ==========================================================================
   NOTIFICATIONS
   ========================================================================== */
.toasts{position:fixed;left:12px;right:12px;bottom:calc(82px + env(safe-area-inset-bottom,0px));z-index:200;display:flex;flex-direction:column;gap:9px;pointer-events:none}
.toast{
  background:#0f172a;color:#fff;padding:12px 15px;border-radius:12px;font-size:.85rem;
  box-shadow:var(--shadow-lg);display:flex;align-items:center;gap:10px;animation:slideUp .2s ease;
}
.toast svg{width:18px;height:18px;flex:0 0 18px}
.toast.ok svg{color:#6ee7b7}
.toast.err{background:#7f1d1d}
.toast.err svg{color:#fca5a5}

/* ==========================================================================
   DIVERS
   ========================================================================== */
.kv{display:flex;flex-direction:column;gap:11px}
.kv-row{display:flex;gap:12px;font-size:.85rem;align-items:flex-start}
.kv-row .k{flex:0 0 108px;color:var(--muted);font-size:.8rem}
.kv-row .v{flex:1;min-width:0;word-break:break-word}
.timeline{display:flex;flex-direction:column;gap:0}
.tl-item{display:flex;gap:12px;padding-bottom:16px;position:relative}
.tl-item:not(:last-child)::before{content:"";position:absolute;left:15px;top:32px;bottom:0;width:2px;background:var(--line)}
.tl-dot{width:32px;height:32px;border-radius:50%;flex:0 0 32px;display:grid;place-items:center;background:var(--brand-soft);color:var(--brand);z-index:1}
.tl-dot svg{width:15px;height:15px}
.tl-body{flex:1;min-width:0;padding-top:3px}
.tl-body b{font-size:.85rem;font-weight:600}
.tl-body p{font-size:.83rem;color:var(--ink-2);margin-top:2px}
.tl-body time{font-size:.72rem;color:var(--muted-2)}
.sep{height:1px;background:var(--line-2);margin:16px 0}
.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;-webkit-overflow-scrolling:touch}
.chip{
  padding:7px 13px;border-radius:20px;border:1px solid var(--line);background:#fff;
  font-size:.8rem;font-weight:600;color:var(--muted);cursor:pointer;white-space:nowrap;transition:.15s;
}
.chip.active{background:var(--ink);border-color:var(--ink);color:#fff}
.switch{display:flex;align-items:center;gap:10px;cursor:pointer;font-size:.86rem}
.switch input{position:absolute;opacity:0;pointer-events:none}
.switch .track{width:42px;height:24px;border-radius:20px;background:#cbd5e1;position:relative;transition:.2s;flex:0 0 42px}
.switch .track::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;transition:.2s}
.switch input:checked + .track{background:var(--ok)}
.switch input:checked + .track::after{transform:translateX(18px)}
.skeleton{background:linear-gradient(90deg,#eef1f7 25%,#f7f9fd 50%,#eef1f7 75%);background-size:200% 100%;animation:sk 1.2s infinite;border-radius:8px}
@keyframes sk{0%{background-position:200% 0}100%{background-position:-200% 0}}
.spinner{width:18px;height:18px;border:2px solid rgba(255,255,255,.35);border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.install-banner{
  display:flex;gap:12px;align-items:center;padding:13px 15px;border-radius:14px;
  background:linear-gradient(120deg,#eef0ff,#f5f0ff);border:1px solid #e3e6ff;margin-bottom:16px;
}
.install-banner .txt{flex:1;min-width:0}
.install-banner b{font-size:.86rem;display:block}
.install-banner p{font-size:.76rem;color:var(--muted)}
.store-icons{display:flex;gap:8px;align-items:center}
.store-icons svg{width:22px;height:22px;color:var(--ink-2)}

/* ==========================================================================
   RESPONSIVE — mobile d'abord, élargissement ensuite
   ========================================================================== */
@media (min-width:600px){
  .stats{grid-template-columns:repeat(2,1fr)}
  .content{padding:22px}
  .form-grid{grid-template-columns:1fr 1fr}
  .toasts{left:auto;right:20px;width:340px;bottom:20px}
}
@media (min-width:768px){
  .page-head{flex-direction:row;align-items:center;justify-content:space-between}
  .board{grid-template-columns:repeat(2,minmax(0,1fr))}
  .cal-day{min-height:104px}
  .overlay{align-items:center;padding:24px}
  .modal{border-radius:var(--radius-lg);max-height:88dvh}
  .modal-head{border-radius:var(--radius-lg) var(--radius-lg) 0 0}
}
@media (min-width:1024px){
  .shell{grid-template-columns:var(--side-w) minmax(0,1fr)}
  .side{display:flex}
  .tabbar{display:none}
  .main{padding-bottom:0}
  .topbar{padding:16px 28px}
  .content{padding:26px 28px}
  .stats{grid-template-columns:repeat(4,1fr)}
  .board{grid-template-columns:repeat(3,minmax(0,1fr))}
  .col-body{max-height:none}
  .grid-2{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(0,1fr);gap:16px}
  .grid-2b{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px}
  .toasts{width:360px}
}
@media (min-width:1280px){
  .board{grid-template-columns:repeat(6,minmax(0,1fr))}
}
@media (min-width:900px){
  .auth{grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr)}
  .auth-visual{display:flex}
}

/* garde-fous petits écrans */
@media (max-width:767px){
  .grid-2,.grid-2b{display:block}
  .grid-2 > *,.grid-2b > *{margin-bottom:14px}
  .grid-2 > *:last-child,.grid-2b > *:last-child{margin-bottom:0}
  .cal-grid{gap:2px}
  .cal-day{min-height:56px;padding:4px;border-radius:8px}
  .cal-ev{font-size:.56rem;padding:1px 4px}
  .kv-row{flex-direction:column;gap:2px}
  .kv-row .k{flex:none}
  .modal{max-height:94dvh}
  .list-item{flex-wrap:wrap}
  .agenda-time{flex:0 0 54px;font-size:.74rem}
  .cal-title{min-width:0}
  .install-banner{align-items:flex-start;flex-wrap:wrap}
  .install-banner .btn{width:100%}
}
@media (max-width:420px){
  .topbar-actions .btn{font-size:.72rem;padding:6px 9px}
  .stat .value{font-size:1.45rem}
  .cal-day{min-height:50px}
}
