/* ==========================================================================
   TaskPilot — système visuel « Altitude » (mode clair)
   --------------------------------------------------------------------------
   Chargé APRÈS le CDN Tailwind sur toutes les pages (base.html, login.html,
   tache_publique.html). Tailwind sert aux utilitaires de mise en page
   (flex, grid, gap, breakpoints) ; ce fichier porte l'identité visuelle :
   jetons, composants, animations et la couche mobile.
   Toutes les classes maison sont préfixées « tp- ».
   ========================================================================== */

:root {
  --bg: #F3F5F9;
  --s1: #FFFFFF;
  --s2: #F6F7FA;
  --s3: #E8EAF0;
  --line: rgba(12, 16, 28, .08);
  --line2: rgba(12, 16, 28, .15);
  --tx: #0B0D14;
  --tx2: #4A5163;
  --tx3: #596174;

  --acc: #2B5CFF;
  --acc-hover: #2350E6;
  --acc-tx: #2350E6;
  --acc-bg: rgba(43, 92, 255, .09);
  --on-acc: #FFFFFF;
  --glow: rgba(43, 92, 255, .30);

  --red: #E5484D;
  --red-strong: #D93636;
  --red-tx: #C42B2B;
  --red-bg: rgba(220, 50, 50, .10);
  --amb: #C97A00;
  --amb-tx: #9A5B00;
  --amb-bg: rgba(242, 154, 0, .13);
  --ok: #0E9F5E;
  --ok-strong: #087F4B;
  --ok-tx: #067647;
  --ok-bg: rgba(18, 183, 106, .12);
  --vio: #C026D3;
  --vio-tx: #A21CAF;
  --vio-bg: rgba(192, 38, 211, .09);
  --gry: #8B92A5;
  --gry-tx: #4A5163;
  --gry-bg: rgba(90, 97, 116, .12);
  --badge: #D93636;

  --glass: rgba(255, 255, 255, .82);
  --hi: inset 0 1px 0 rgba(255, 255, 255, .9);
  --sh: 0 18px 36px -22px rgba(20, 25, 45, .30);
  --shd: rgba(30, 41, 80, .14);
  --shd2: rgba(30, 41, 80, .24);
  --card: linear-gradient(180deg, #FFFFFF 0%, #FAFBFD 100%);
  --brand-grad: linear-gradient(145deg, #7E9DFF 0%, #2B5CFF 50%, #1F45E0 100%);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-d: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.45, .5, 1);
  --nav-h: 70px;
  --sidebar-w: 268px;
  color-scheme: light;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(43, 92, 255, .12);
  scroll-padding-top: 5.5rem;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--tx);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  position: relative;
  isolation: isolate;
}
img, video, canvas { max-width: 100%; }
a, button, input, select, textarea, label, summary, [role="button"] { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
::placeholder { color: var(--tx3); opacity: 1; }
::selection { background: rgba(43, 92, 255, .18); }
main { overflow-wrap: break-word; }

/* Un élément « tp- » masqué par la classe Tailwind `hidden` (modales, badges,
   formulaires repliables) doit rester masqué même si son composant déclare un
   display : la règle ci-dessous est plus spécifique que le composant. */
[class*="tp-"].hidden { display: none !important; }
[hidden] { display: none !important; }

.fd { font-family: var(--font-d); font-optical-sizing: auto; }
.tx { color: var(--tx); }
.tx2 { color: var(--tx2); }
.tx3 { color: var(--tx3); }
.acc-tx { color: var(--acc-tx); }
.red-tx { color: var(--red-tx); }
.amb-tx { color: var(--amb-tx); }
.ok-tx { color: var(--ok-tx); }
.vio-tx { color: var(--vio-tx); }
.num { font-variant-numeric: tabular-nums; }
.tp-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tp-noscroll { scrollbar-width: none; -ms-overflow-style: none; }
.tp-noscroll::-webkit-scrollbar { display: none; }

/* Visibilité responsive (enveloppes simples, sans autre classe tp-) */
@media (min-width: 768px) { .tp-m-only { display: none !important; } }
@media (max-width: 767.98px) { .tp-d-only { display: none !important; } }

/* Lumières d'ambiance */
.tp-orb { position: fixed; z-index: -1; pointer-events: none; border-radius: 50%; }
.tp-orb-1 { top: -220px; right: -180px; width: 560px; height: 560px; background: radial-gradient(circle, rgba(43, 92, 255, .13) 0%, transparent 65%); animation: tp-drift 18s ease-in-out infinite alternate; }
.tp-orb-2 { bottom: -240px; left: -220px; width: 560px; height: 560px; background: radial-gradient(circle, rgba(56, 189, 248, .12) 0%, transparent 65%); animation: tp-drift 22s ease-in-out infinite alternate-reverse; }

/* --------------------------------------------------------------------------
   Shell : barre latérale (bureau), barre du haut, contenu, barre du bas (mobile)
   -------------------------------------------------------------------------- */
.tp-app { min-height: 100vh; min-height: 100dvh; display: flex; }
.tp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.tp-sidebar { display: none; }
@media (min-width: 1024px) {
  .tp-sidebar {
    position: sticky; top: 0; height: 100vh; height: 100dvh;
    width: var(--sidebar-w); flex: none;
    display: flex; flex-direction: column; gap: 6px;
    padding: 22px 16px 18px;
    background: rgba(255, 255, 255, .7);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    border-right: 1px solid var(--line);
    overflow-y: auto;
  }
}
.tp-side-brand { padding: 4px 8px 18px; }
.tp-side-label { margin: 14px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tx3); }
.tp-side-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 46px; padding: 0 12px; border-radius: 14px;
  color: var(--tx2); font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background-color .2s, color .2s, transform .18s var(--ease);
}
.tp-side-link:hover { background: var(--s2); color: var(--tx); }
.tp-side-link:active { transform: scale(.98); }
.tp-side-link.is-active { background: var(--acc); color: #fff; font-weight: 700; box-shadow: 0 12px 24px -14px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .3); }
.tp-side-link svg { flex: none; }
.tp-side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }

.tp-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 640px) { .tp-topbar { padding-left: 24px; padding-right: 24px; } }
@media (min-width: 1024px) { .tp-topbar { padding: 14px 36px; } .tp-topbar .tp-logo { display: none; } }
.tp-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.tp-search { position: relative; flex: 1; max-width: 420px; }
.tp-search > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--tx3); pointer-events: none; }
.tp-search input {
  width: 100%; height: 44px; border-radius: 14px; border: 1px solid var(--line2);
  background: var(--s1); color: var(--tx); padding: 0 14px 0 42px;
  font: inherit; font-size: 14px; outline: none; box-shadow: var(--hi);
  transition: border-color .2s, box-shadow .2s;
}
.tp-search input:focus { border-color: var(--acc); box-shadow: 0 0 0 4px rgba(43, 92, 255, .14); }
@media (max-width: 1023.98px) {
  .tp-search { display: none; position: absolute; left: 12px; right: 12px; top: calc(100% + 8px); max-width: none; }
  .tp-search.is-open { display: block; animation: tp-rise .35s var(--ease) both; }
  .tp-search.is-open input { height: 50px; box-shadow: 0 18px 40px -18px var(--shd2); }
}
@media (min-width: 1024px) { .tp-search-toggle { display: none !important; } }

.tp-content { width: 100%; max-width: 1240px; margin: 0 auto; padding: 20px 16px calc(var(--nav-h) + 52px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .tp-content { padding-left: 24px; padding-right: 24px; } }
@media (min-width: 1024px) { .tp-content { padding: 30px 36px 56px; } }

.tp-bottomnav {
  position: fixed; z-index: 50;
  left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto;
  height: var(--nav-h); padding: 0 8px; border-radius: 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--line2);
  box-shadow: var(--hi), 0 24px 44px -16px var(--shd2);
}
@media (min-width: 1024px) { .tp-bottomnav { display: none; } }
.tp-bn-item {
  flex: 1 1 0; min-width: 0; height: 52px; border-radius: 19px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  color: var(--tx2); font-size: 13px; font-weight: 700; text-decoration: none;
  transition: flex-grow .35s var(--ease), background-color .25s, color .2s, transform .18s var(--ease);
}
.tp-bn-item:active { transform: scale(.94); }
.tp-bn-item > span { display: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-bn-item.is-active { flex-grow: 2.1; background: var(--acc); color: #fff; box-shadow: 0 10px 22px -10px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .3); }
.tp-bn-item.is-active > span { display: inline; }
@media (max-width: 359.98px) { .tp-bn-item.is-active { flex-grow: 1.2; } .tp-bn-item.is-active > span { display: none; } }

/* --------------------------------------------------------------------------
   Logo
   -------------------------------------------------------------------------- */
.tp-logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-d); font-size: 20px; font-weight: 780; letter-spacing: -.035em; color: var(--tx); text-decoration: none; min-height: 44px; }
.tp-logo em { font-style: normal; color: var(--acc-tx); }
.tp-mark {
  width: 38px; height: 38px; flex: none; border-radius: 12px;
  background: var(--brand-grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -3px 6px rgba(10, 25, 110, .3), 0 10px 20px -8px var(--glow);
  display: inline-flex; align-items: center; justify-content: center;
}
.tp-mark svg { width: 74%; height: 74%; }

/* Logo 3D extrudé (connexion, lien collaborateur) */
.tp-ext { position: relative; display: flex; align-items: center; justify-content: center; perspective: 800px; }
.tp-ext-floor { position: absolute; bottom: 0; left: 50%; width: 80%; transform: translateX(-50%); height: 22px; border-radius: 50%; background: radial-gradient(ellipse, var(--shd2), transparent 70%); }
.tp-ext-body { position: relative; transform-style: preserve-3d; transform: rotateX(14deg) rotateY(-22deg); animation: tp-sway 7s ease-in-out infinite; }
.tp-ext-body > i { position: absolute; inset: 0; border-radius: 30%; }
.tp-ext-body > i:nth-child(1) { background: #0A1868; transform: translateZ(-21px); }
.tp-ext-body > i:nth-child(2) { background: #0C1C78; transform: translateZ(-18px); }
.tp-ext-body > i:nth-child(3) { background: #10248C; transform: translateZ(-15px); }
.tp-ext-body > i:nth-child(4) { background: #142BA0; transform: translateZ(-12px); }
.tp-ext-body > i:nth-child(5) { background: #1833B4; transform: translateZ(-9px); }
.tp-ext-body > i:nth-child(6) { background: #1C3BC6; transform: translateZ(-6px); }
.tp-ext-body > i:nth-child(7) { background: #2042D4; transform: translateZ(-3px); }
.tp-ext-face { position: absolute; inset: 0; border-radius: 30%; background: var(--brand-grad); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), inset 0 -8px 16px rgba(10, 25, 110, .3); overflow: hidden; }
.tp-ext-face::after { content: ""; position: absolute; left: 10%; right: 10%; top: 5%; height: 44%; border-radius: 50%; background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0)); }
.tp-ext-glyph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transform: translateZ(24px); filter: drop-shadow(0 12px 10px rgba(8, 24, 110, .45)); }
.tp-ext-glyph svg { width: 72%; height: 72%; }

/* --------------------------------------------------------------------------
   Titres de page et de section
   -------------------------------------------------------------------------- */
.tp-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 16px; margin-bottom: 22px; }
.tp-eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tx3); }
.tp-h1 { margin: 0; font-family: var(--font-d); font-size: clamp(28px, 6.4vw, 40px); font-weight: 750; letter-spacing: -.035em; line-height: 1.05; }
.tp-sub { margin: 6px 0 0; font-size: 14px; font-weight: 500; line-height: 1.5; color: var(--tx3); }
.tp-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 639.98px) { .tp-actions.is-stretch { width: 100%; } .tp-actions.is-stretch > * { flex: 1 1 auto; } }
.tp-section { margin-top: 30px; }
.tp-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tp-h2 { margin: 0; font-family: var(--font-d); font-size: 21px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.tp-h3 { margin: 0; font-family: var(--font-d); font-size: 18px; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
.tp-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--acc-tx); font-size: 13px; font-weight: 650; text-decoration: none; }
.tp-link:hover { text-decoration: underline; }
.tp-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 14px 0 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--s1); color: var(--tx2); font-size: 13px; font-weight: 650; text-decoration: none; box-shadow: var(--hi); margin-bottom: 16px; }
.tp-back:hover { color: var(--tx); background: var(--s2); }

/* --------------------------------------------------------------------------
   Cartes
   -------------------------------------------------------------------------- */
.tp-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--hi), var(--sh); }
.tp-card-flat { position: relative; background: var(--s1); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--hi); }
.tp-card-soft { position: relative; background: var(--s2); border: 1px solid var(--line); border-radius: 18px; }
.tp-p { padding: 18px; }
@media (min-width: 640px) { .tp-p { padding: 22px; } }
.tp-lift { transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s; }
@media (hover: hover) { .tp-lift:hover { transform: translateY(-3px); border-color: var(--line2); box-shadow: var(--hi), 0 26px 44px -24px var(--shd2); } }
.tp-hero { overflow: hidden; }
.tp-hero::before { content: ""; position: absolute; top: -90px; right: -70px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(43, 92, 255, .14) 0%, transparent 65%); pointer-events: none; }

/* Bandeaux colorés (validation, info, alerte) */
.tp-banner { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 22px; border: 1px solid var(--line); }
.tp-banner.is-vio { background: var(--vio-bg); }
.tp-banner.is-ok { background: var(--ok-bg); }
.tp-banner.is-red { background: var(--red-bg); }
.tp-banner.is-amb { background: var(--amb-bg); }
.tp-banner.is-blue { background: var(--acc-bg); }
.tp-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; font-size: 13px; line-height: 1.5; font-weight: 550; }
.tp-note svg { flex: none; margin-top: 1px; }
.tp-note.is-blue { background: var(--acc-bg); color: var(--acc-tx); }
.tp-note.is-vio { background: var(--vio-bg); color: var(--vio-tx); }
.tp-note.is-amb { background: var(--amb-bg); color: var(--amb-tx); }
.tp-note.is-gry { background: var(--s2); color: var(--tx2); border: 1px solid var(--line); }
.tp-quote { margin: 0; padding: 12px 14px; border-radius: 16px; background: var(--s2); border: 1px solid var(--line); font-size: 13px; line-height: 1.55; color: var(--tx2); }

/* --------------------------------------------------------------------------
   Indicateurs (KPI) et pastilles d'icône 3D
   -------------------------------------------------------------------------- */
.tp-kpi { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-height: 148px; padding: 16px; border-radius: 24px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--hi), var(--sh); color: var(--tx); text-decoration: none; overflow: hidden; transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s; }
@media (hover: hover) { .tp-kpi:hover { transform: translateY(-4px) perspective(800px) rotateX(4deg); border-color: var(--line2); box-shadow: var(--hi), 0 28px 46px -26px var(--shd2); } }
.tp-kpi:active { transform: scale(.98); }
.tp-kpi-top { display: flex; align-items: flex-start; justify-content: space-between; }
.tp-kpi-num { font-family: var(--font-d); font-size: 40px; font-weight: 750; line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.tp-kpi-label { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--tx2); }
.tp-ic { width: 46px; height: 46px; flex: none; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -3px 0 rgba(0, 0, 0, .2), 0 12px 22px -10px var(--icg, rgba(0, 0, 0, .3)); }
.tp-ic.is-sm { width: 38px; height: 38px; border-radius: 13px; }
.tp-ic.is-lg { width: 54px; height: 54px; border-radius: 18px; }
.ic-blue { background: linear-gradient(145deg, #7E9DFF 0%, #2B5CFF 50%, #1A3BC9 100%); color: #fff; --icg: rgba(43, 92, 255, .55); }
.ic-red { background: linear-gradient(145deg, #FFA3A3 0%, #FF5D5D 50%, #D42F2F 100%); color: #2A0505; --icg: rgba(255, 93, 93, .55); }
.ic-amb { background: linear-gradient(145deg, #FFD796 0%, #FFB43D 50%, #E08A00 100%); color: #2A1700; --icg: rgba(255, 180, 61, .6); }
.ic-ok { background: linear-gradient(145deg, #6EE7B7 0%, #12B76A 50%, #067647 100%); color: #fff; --icg: rgba(18, 183, 106, .5); }
.ic-vio { background: linear-gradient(145deg, #F5B8FF 0%, #D946EF 50%, #A21CAF 100%); color: #fff; --icg: rgba(217, 70, 239, .5); }
.ic-gry { background: linear-gradient(145deg, #C9CEDB 0%, #8B92A5 50%, #5E6578 100%); color: #10131B; --icg: rgba(139, 146, 165, .55); }

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */
.tp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 16px; border: 1px solid transparent;
  font: inherit; font-size: 14px; font-weight: 700; line-height: 1.1; text-align: center;
  text-decoration: none; cursor: pointer; user-select: none;
  transition: transform .18s var(--ease), box-shadow .25s, background-color .25s, border-color .25s, color .2s;
}
.tp-btn:active { transform: scale(.97); }
.tp-btn:disabled, .tp-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.tp-btn svg { flex: none; }
.tp-btn-primary { background: var(--acc); color: #fff; box-shadow: 0 14px 28px -14px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -3px 0 rgba(0, 0, 0, .16); }
.tp-btn-primary:hover { background: var(--acc-hover); }
.tp-btn-secondary { background: var(--s1); color: var(--tx); border-color: var(--line2); box-shadow: var(--hi); }
.tp-btn-secondary:hover { background: var(--s2); }
.tp-btn-ghost { background: transparent; color: var(--tx2); border-color: var(--line2); }
.tp-btn-ghost:hover { background: var(--s2); color: var(--tx); }
.tp-btn-danger { background: var(--red-strong); color: #fff; box-shadow: 0 12px 24px -14px rgba(217, 54, 54, .6), inset 0 -3px 0 rgba(0, 0, 0, .16); }
.tp-btn-danger:hover { background: #C42B2B; }
.tp-btn-danger-soft { background: var(--red-bg); color: var(--red-tx); border-color: rgba(220, 50, 50, .18); }
.tp-btn-danger-soft:hover { background: rgba(220, 50, 50, .16); }
.tp-btn-ok { background: var(--ok-strong); color: #fff; box-shadow: 0 12px 24px -14px rgba(8, 127, 75, .6), inset 0 -3px 0 rgba(0, 0, 0, .16); }
.tp-btn-ok:hover { background: #066B3F; }
.tp-btn-dark { background: var(--tx); color: #fff; }
.tp-btn-dark:hover { background: #22252F; }
.tp-btn-sm { min-height: 40px; padding: 0 14px; border-radius: 13px; font-size: 13px; }
.tp-btn-lg { min-height: 56px; padding: 0 22px; border-radius: 19px; font-size: 15px; }
.tp-btn-block { width: 100%; }

.tp-icon-btn {
  position: relative; width: 46px; height: 46px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 15px; border: 1px solid var(--line); background: var(--s1); color: var(--tx);
  box-shadow: var(--hi); cursor: pointer; text-decoration: none;
  transition: transform .18s var(--ease), background-color .2s, color .2s, border-color .2s;
}
.tp-icon-btn:hover { background: var(--s2); }
.tp-icon-btn:active { transform: scale(.94); }
.tp-icon-btn.is-active { background: var(--acc-bg); color: var(--acc-tx); border-color: transparent; }
.tp-icon-btn.is-primary { background: var(--acc); color: #fff; border-color: transparent; box-shadow: 0 10px 20px -10px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .3); }
.tp-icon-btn.is-danger { background: var(--red-bg); color: var(--red-tx); border-color: rgba(220, 50, 50, .18); }
.tp-icon-btn.is-ok { background: var(--ok-bg); color: var(--ok-tx); border-color: transparent; }
.tp-icon-btn.is-sm { width: 40px; height: 40px; border-radius: 13px; }
.tp-icon-btn.is-dark { background: linear-gradient(145deg, #2C3148, #161926); color: #F3F5F9; border-color: rgba(255, 255, 255, .1); }

.tp-fab {
  position: fixed; z-index: 45; right: 16px;
  bottom: calc(var(--nav-h) + 26px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 10px;
  height: 58px; padding: 0 22px 0 18px; border-radius: 22px;
  background: var(--brand-grad); color: #fff; font-size: 15px; font-weight: 700; text-decoration: none; border: 0; cursor: pointer;
  box-shadow: 0 20px 36px -12px rgba(43, 92, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -4px 0 rgba(0, 0, 0, .18);
  animation: tp-float 5s ease-in-out infinite;
}
.tp-fab:active { transform: scale(.95); }
@media (min-width: 1024px) { .tp-fab { bottom: 30px; right: 36px; } .tp-fab.is-m { display: none; } }

/* --------------------------------------------------------------------------
   Pastilles, badges, drapeaux
   -------------------------------------------------------------------------- */
.tp-badge { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--badge); color: #fff; font-size: 11px; font-weight: 800; line-height: 1; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px var(--s1); }
.tp-badge.is-inline { position: static; margin-left: auto; box-shadow: none; }
.tp-side-link.is-active .tp-badge.is-inline { background: #fff; color: var(--acc-tx); }
.tp-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--s2); color: var(--tx2); font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap; }
.tp-pill.is-lg { height: 30px; padding: 0 12px; font-size: 13px; }
.tp-pill.is-sm { height: 22px; padding: 0 8px; font-size: 11px; }
.pill-blue { background: var(--acc-bg); color: var(--acc-tx); border-color: transparent; }
.pill-red { background: var(--red-bg); color: var(--red-tx); border-color: transparent; }
.pill-amb { background: var(--amb-bg); color: var(--amb-tx); border-color: transparent; }
.pill-ok { background: var(--ok-bg); color: var(--ok-tx); border-color: transparent; }
.pill-vio { background: var(--vio-bg); color: var(--vio-tx); border-color: transparent; }
.pill-gry { background: var(--gry-bg); color: var(--gry-tx); border-color: transparent; }
.pill-solid { background: var(--acc); color: #fff; border-color: transparent; }
.tp-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.tp-dot.is-pulse { animation: tp-pulse 2s ease-out infinite; }
.tp-flag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; color: var(--tx2); white-space: nowrap; }
.tp-flag svg { flex: none; }
.tp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12px; color: var(--tx3); }
.tp-meta > span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }

/* --------------------------------------------------------------------------
   Filtres : puces et contrôle segmenté
   -------------------------------------------------------------------------- */
.tp-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; }
.tp-chips::-webkit-scrollbar { display: none; }
@media (min-width: 640px) { .tp-chips { margin: 0; padding: 2px 0; flex-wrap: wrap; } }
.tp-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--s1); color: var(--tx2); font-size: 13px; font-weight: 700; white-space: nowrap; text-decoration: none; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s, transform .18s var(--ease); }
.tp-chip:hover { border-color: var(--line2); color: var(--tx); }
.tp-chip:active { transform: scale(.96); }
.tp-chip.is-active { background: var(--tx); border-color: var(--tx); color: #fff; }
.tp-chip .tp-count { opacity: .7; font-variant-numeric: tabular-nums; }

.tp-seg { display: flex; gap: 4px; padding: 4px; border-radius: 18px; background: var(--s2); border: 1px solid var(--line); }
.tp-seg-item { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 10px; border: 0; border-radius: 14px; background: transparent; color: var(--tx2); font: inherit; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .25s, color .2s, box-shadow .25s; }
.tp-seg-item:hover { color: var(--tx); }
.tp-seg-item.is-active { background: var(--s1); color: var(--tx); box-shadow: var(--hi), 0 6px 16px -8px var(--shd2); }
.tp-seg-item .tp-count { color: var(--tx3); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Formulaires
   -------------------------------------------------------------------------- */
.tp-form-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .tp-form-grid.is-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .tp-form-grid.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tp-form-grid.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 640px) and (max-width: 1023.98px) { .tp-form-grid.is-3, .tp-form-grid.is-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tp-span-all { grid-column: 1 / -1; }
.tp-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.tp-label { font-size: 13px; font-weight: 650; color: var(--tx2); }
.tp-label small { font-weight: 500; color: var(--tx3); }
.tp-input, .tp-select, .tp-textarea {
  width: 100%; min-height: 50px; border-radius: 15px; border: 1px solid var(--line2);
  background: var(--s1); color: var(--tx); padding: 0 14px;
  font: inherit; font-size: 15px; font-weight: 500;
  box-shadow: var(--hi); outline: none;
  -webkit-appearance: none; appearance: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.tp-input:focus, .tp-select:focus, .tp-textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 4px rgba(43, 92, 255, .14); }
.tp-input.is-soft, .tp-select.is-soft, .tp-textarea.is-soft { background: var(--s2); }
.tp-textarea { padding: 12px 14px; min-height: 96px; line-height: 1.5; resize: vertical; }
.tp-select {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23596174' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
.tp-select.is-sm, .tp-input.is-sm { min-height: 44px; border-radius: 13px; font-size: 14px; }
.tp-input[type="date"] { min-width: 0; }
.tp-input[type="file"] { padding: 10px 12px; }
.tp-input[type="file"]::file-selector-button { margin-right: 12px; border: 0; border-radius: 10px; background: var(--acc-bg); color: var(--acc-tx); font: inherit; font-weight: 700; padding: 8px 12px; cursor: pointer; }
.tp-iw { position: relative; }
.tp-iw > svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--tx3); pointer-events: none; }
.tp-iw > .tp-input, .tp-iw > .tp-select { padding-left: 44px; }
.tp-help { font-size: 12px; line-height: 1.5; color: var(--tx3); margin: 0; }
.tp-title-input { min-height: 60px; font-family: var(--font-d); font-size: 20px; font-weight: 650; letter-spacing: -.01em; }

.tp-check { -webkit-appearance: none; appearance: none; margin: 0; width: 24px; height: 24px; flex: none; border-radius: 8px; border: 1.5px solid var(--line2); background: var(--s1); display: inline-grid; place-content: center; cursor: pointer; transition: background-color .2s, border-color .2s; }
.tp-check::after { content: ""; width: 10px; height: 5px; border-left: 2.2px solid #fff; border-bottom: 2.2px solid #fff; transform: rotate(-45deg) scale(0); margin-top: -3px; transition: transform .22s var(--spring); }
.tp-check:checked { background: var(--acc); border-color: var(--acc); }
.tp-check:checked::after { transform: rotate(-45deg) scale(1); }
.tp-check.is-round { border-radius: 50%; }

.tp-switch { -webkit-appearance: none; appearance: none; margin: 0; width: 54px; height: 32px; flex: none; border-radius: 999px; background: var(--s3); border: 1px solid var(--line2); position: relative; cursor: pointer; transition: background-color .25s, border-color .25s; }
.tp-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(20, 25, 45, .3); transition: transform .35s var(--spring); }
.tp-switch:checked { background: var(--acc); border-color: var(--acc); }
.tp-switch:checked::after { transform: translateX(22px); }

/* Puces sélectionnables (collaborateurs, priorités…) : case native cachée */
.tp-pick { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px 0 6px; border-radius: 999px; border: 1.5px solid var(--line2); background: var(--s1); color: var(--tx); font-size: 13px; font-weight: 650; cursor: pointer; user-select: none; transition: border-color .2s, background-color .2s, transform .18s var(--ease); }
.tp-pick:active { transform: scale(.97); }
.tp-pick > input { position: absolute; opacity: 0; pointer-events: none; }
.tp-pick:has(input:checked) { border-color: var(--acc); background: var(--acc-bg); }
.tp-pick:has(input:focus-visible) { outline: 2px solid var(--acc); outline-offset: 2px; }
.tp-pick .tp-pick-tick { width: 18px; height: 18px; border-radius: 50%; background: var(--acc); color: #fff; display: none; align-items: center; justify-content: center; margin-left: -2px; }
.tp-pick:has(input:checked) .tp-pick-tick { display: inline-flex; animation: tp-pop .35s var(--spring) both; }

/* --------------------------------------------------------------------------
   Listes, tuiles de date, tableaux
   -------------------------------------------------------------------------- */
.tp-stack-list { display: flex; flex-direction: column; gap: 10px; }
.tp-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--hi); color: var(--tx); text-decoration: none; transition: transform .25s var(--ease), border-color .2s, box-shadow .25s; }
a.tp-row:hover, .tp-row.is-link:hover { border-color: var(--line2); box-shadow: var(--hi), 0 18px 32px -22px var(--shd2); }
a.tp-row:active { transform: scale(.99); }
.tp-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tp-row-title { font-size: 15px; font-weight: 650; line-height: 1.35; color: var(--tx); text-decoration: none; }
a.tp-row-title:hover { color: var(--acc-tx); }
.tp-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tp-datetile { width: 52px; height: 56px; flex: none; border-radius: 16px; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--s2); color: var(--tx2); }
.tp-datetile b { font-family: var(--font-d); font-size: 20px; font-weight: 750; line-height: 1; }
.tp-datetile small { margin-top: 3px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tp-datetile.is-red { background: var(--red-bg); color: var(--red-tx); }
.tp-datetile.is-amb { background: var(--amb-bg); color: var(--amb-tx); }
.tp-datetile.is-gry { background: var(--gry-bg); color: var(--gry-tx); }
.tp-datetile.is-ok { background: var(--ok-bg); color: var(--ok-tx); }
.tp-datetile.is-blue { background: var(--acc-bg); color: var(--acc-tx); }

.tp-table-wrap { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; border-radius: 24px; border: 1px solid var(--line); background: var(--s1); box-shadow: var(--hi), var(--sh); }
.tp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; color: var(--tx2); }
.tp-table th { text-align: left; padding: 13px 16px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tx3); background: var(--s2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tp-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tp-table tbody tr:last-child td { border-bottom: 0; }
.tp-table tbody tr { transition: background-color .2s; }
.tp-table tbody tr:hover { background: var(--s2); }
.tp-table .is-right { text-align: right; }
.tp-table .is-center { text-align: center; }

/* Avatars */
.tp-av { width: 40px; height: 40px; flex: none; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700; letter-spacing: -.01em; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -2px 0 rgba(0, 0, 0, .18); text-transform: uppercase; }
.tp-av.is-xs { width: 24px; height: 24px; border-radius: 8px; font-size: 9px; }
.tp-av.is-sm { width: 30px; height: 30px; border-radius: 10px; font-size: 11px; }
.tp-av.is-lg { width: 58px; height: 58px; border-radius: 20px; font-size: 19px; font-family: var(--font-d); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3), inset 0 -4px 0 rgba(0, 0, 0, .25), 0 14px 24px -12px var(--shd2); }
.av-0 { background: linear-gradient(145deg, #7C63F2, #3F27A8); }
.av-1 { background: linear-gradient(145deg, #2E86C9, #124D80); }
.av-2 { background: linear-gradient(145deg, #C25E22, #7E3409); }
.av-3 { background: linear-gradient(145deg, #1C9583, #0C5A4E); }
.av-4 { background: linear-gradient(145deg, #C44884, #7E2250); }
.tp-av-stack { display: flex; }
.tp-av-stack > .tp-av { margin-right: -8px; box-shadow: 0 0 0 3px var(--s1); }

/* --------------------------------------------------------------------------
   Progression : barres, barres empilées, anneaux
   -------------------------------------------------------------------------- */
.tp-bar { position: relative; height: 10px; border-radius: 5px; background: var(--s3); overflow: hidden; }
.tp-bar > span { display: block; height: 100%; border-radius: 5px; background: var(--ok); transform-origin: left center; animation: tp-grow 1.1s var(--ease) both; }
.tp-bar.is-thin { height: 8px; }
.tp-stackbar { display: flex; gap: 2px; height: 10px; transform-origin: left center; animation: tp-grow 1.1s var(--ease) both; }
.tp-stackbar > span { height: 100%; border-radius: 2px; min-width: 0; }
.tp-stackbar > span:first-child { border-top-left-radius: 5px; border-bottom-left-radius: 5px; }
.tp-stackbar > span:last-child { border-top-right-radius: 5px; border-bottom-right-radius: 5px; }
.tp-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; font-weight: 600; color: var(--tx2); }
.tp-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.tp-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bg-acc { background: var(--acc); } .bg-red { background: var(--red); } .bg-amb { background: var(--amb); } .bg-ok { background: var(--ok); } .bg-gry { background: var(--gry); } .bg-vio { background: var(--vio); }
.tp-ring-track { stroke: var(--s3); }
.tp-ring-val { stroke: var(--ok); animation: tp-draw 1.8s var(--ease) both; }

/* Frise chronologique */
.tp-tl { list-style: none; margin: 0; padding: 0; }
.tp-tl > li { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.tp-tl > li::before { content: ""; position: absolute; left: 15px; top: 36px; bottom: 2px; width: 2px; border-radius: 1px; background: var(--line2); }
.tp-tl > li:last-child { padding-bottom: 0; }
.tp-tl > li:last-child::before { display: none; }
.tp-tl-ic { position: relative; width: 32px; height: 32px; flex: none; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; }

/* États vides */
.tp-empty { padding: 30px 20px; border-radius: 24px; border: 1px dashed var(--line2); text-align: center; color: var(--tx2); font-size: 14px; background: rgba(255, 255, 255, .5); }
.tp-empty .tp-h3 { color: var(--tx); margin-bottom: 4px; }
.tp-orb3d { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; background: radial-gradient(circle at 32% 28%, #E6ECFF 0%, #6B8CFF 32%, #2B5CFF 60%, #12289A 100%); box-shadow: 0 18px 30px -10px rgba(43, 92, 255, .55), inset -6px -10px 16px rgba(0, 0, 0, .2); animation: tp-float 6s ease-in-out infinite; }
.tp-orb3d.is-ok { background: radial-gradient(circle at 32% 28%, #E3FFF2 0%, #4ADE9B 34%, #0E9F5E 66%, #04452A 100%); box-shadow: 0 18px 30px -10px rgba(14, 159, 94, .5), inset -6px -10px 16px rgba(0, 0, 0, .2); }

/* --------------------------------------------------------------------------
   Messages flash et pop-up de notification
   -------------------------------------------------------------------------- */
.tp-flashes { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.tp-flash { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line); font-size: 14px; font-weight: 600; line-height: 1.45; animation: tp-rise .6s var(--ease) both; }
.tp-flash svg { flex: none; }
.tp-flash.is-success { background: var(--ok-bg); color: var(--ok-tx); }
.tp-flash.is-danger { background: var(--red-bg); color: var(--red-tx); }
.tp-flash.is-info { background: var(--amb-bg); color: var(--amb-tx); }
.tp-toasts { position: fixed; z-index: 100; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
@media (min-width: 640px) { .tp-toasts { left: auto; right: 24px; } }
@media (min-width: 1024px) { .tp-toasts { bottom: 24px; right: 36px; } }
.tp-toast { pointer-events: auto; width: 100%; max-width: 390px; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 22px; background: var(--s1); border: 1px solid var(--line2); box-shadow: 0 24px 48px -20px var(--shd2); transition: opacity .3s, transform .3s var(--ease); }
.tp-toast.is-enter { opacity: 0; transform: translateY(10px); }

/* --------------------------------------------------------------------------
   Modales : feuille du bas sur mobile, boîte centrée sur grand écran
   -------------------------------------------------------------------------- */
.tp-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(20, 24, 38, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@media (min-width: 640px) { .tp-modal { align-items: center; padding: 24px; } }
.tp-sheet { position: relative; width: 100%; max-width: 640px; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column; background: var(--s1); border-radius: 30px 30px 0 0; box-shadow: 0 -30px 60px -20px var(--shd2); overflow: hidden; animation: tp-sheet .5s var(--ease) both; padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 640px) { .tp-sheet { border-radius: 28px; animation-name: tp-pop; padding-bottom: 0; } }
.tp-sheet.is-sm { max-width: 480px; }
.tp-sheet-handle { align-self: center; width: 44px; height: 5px; border-radius: 3px; background: var(--line2); margin-top: 10px; flex: none; }
@media (min-width: 640px) { .tp-sheet-handle { display: none; } }
.tp-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 10px; }
.tp-sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 20px 18px; }
.tp-sheet-foot { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px 20px; border-top: 1px solid var(--line); background: var(--s1); }
body:has(.tp-modal:not(.hidden)) { overflow: hidden; }

/* Repliables (<details>) */
.tp-details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 18px; font-size: 16px; font-weight: 700; }
.tp-details > summary::-webkit-details-marker { display: none; }
.tp-details > summary .tp-chev { margin-left: auto; color: var(--tx3); transition: transform .3s var(--ease); }
.tp-details[open] > summary .tp-chev { transform: rotate(180deg); }
.tp-details-body { padding: 0 18px 18px; animation: tp-rise .4s var(--ease) both; }

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
.tp-rise { animation: tp-rise .7s var(--ease) both; }
.tp-stagger > * { animation: tp-rise .7s var(--ease) both; }
.tp-stagger > *:nth-child(2) { animation-delay: .05s; }
.tp-stagger > *:nth-child(3) { animation-delay: .1s; }
.tp-stagger > *:nth-child(4) { animation-delay: .15s; }
.tp-stagger > *:nth-child(5) { animation-delay: .2s; }
.tp-stagger > *:nth-child(6) { animation-delay: .25s; }
.tp-stagger > *:nth-child(7) { animation-delay: .3s; }
.tp-stagger > *:nth-child(n+8) { animation-delay: .34s; }
.tp-float { animation: tp-float 6s ease-in-out infinite; }
.tp-bell { animation: tp-bell 3.4s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes tp-rise { from { opacity: .01; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes tp-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes tp-drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-50px, 40px) scale(1.12); } }
@keyframes tp-draw { from { stroke-dasharray: 0 100; } }
@keyframes tp-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes tp-pulse { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .55); } 100% { box-shadow: 0 0 0 10px rgba(229, 72, 77, 0); } }
@keyframes tp-sheet { from { transform: translateY(60px); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes tp-pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tp-sway { 0%, 100% { transform: rotateX(14deg) rotateY(-24deg) translateY(0); } 50% { transform: rotateX(8deg) rotateY(-6deg) translateY(-10px); } }
@keyframes tp-bell { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 80% { transform: rotate(-12deg); } 85% { transform: rotate(8deg); } 90% { transform: rotate(-4deg); } }
@keyframes tp-spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   FullCalendar (agenda)
   -------------------------------------------------------------------------- */
.fc {
  --fc-border-color: rgba(12, 16, 28, .08);
  --fc-page-bg-color: #FFFFFF;
  --fc-neutral-bg-color: #F6F7FA;
  --fc-today-bg-color: rgba(43, 92, 255, .07);
  --fc-button-bg-color: #FFFFFF;
  --fc-button-border-color: rgba(12, 16, 28, .15);
  --fc-button-text-color: #0B0D14;
  --fc-button-hover-bg-color: #F6F7FA;
  --fc-button-hover-border-color: rgba(12, 16, 28, .2);
  --fc-button-active-bg-color: #2B5CFF;
  --fc-button-active-border-color: #2B5CFF;
  --fc-event-border-color: transparent;
  --fc-list-event-hover-bg-color: #F6F7FA;
  font-family: var(--font);
  font-size: 13px;
}
.fc .fc-toolbar { flex-wrap: wrap; gap: 10px; }
.fc .fc-toolbar-title { font-family: var(--font-d); font-size: 20px !important; font-weight: 700; letter-spacing: -.015em; text-transform: capitalize; color: var(--tx); }
.fc .fc-button { border-radius: 12px !important; font-weight: 700; font-size: 13px; padding: 8px 12px; box-shadow: var(--hi) !important; text-transform: capitalize; }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active { color: #fff; }
.fc .fc-button-group { gap: 4px; }
.fc .fc-button-group > .fc-button { border-radius: 12px !important; }
.fc .fc-button:focus { box-shadow: 0 0 0 4px rgba(43, 92, 255, .18) !important; }
.fc .fc-col-header-cell-cushion { padding: 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tx3); text-decoration: none; }
.fc .fc-daygrid-day-number { font-weight: 650; color: var(--tx2); text-decoration: none; padding: 6px 8px; }
.fc .fc-day-today .fc-daygrid-day-number { color: #fff; background: var(--acc); border-radius: 10px; margin: 4px; padding: 3px 8px; }
.fc .fc-scrollgrid { border-radius: 18px; overflow: hidden; }
.fc-theme-standard .fc-scrollgrid { border-color: var(--line); }
.fc .fc-event { border-radius: 8px; padding: 2px 6px; font-weight: 650; font-size: 12px; cursor: grab; box-shadow: 0 6px 12px -8px rgba(20, 25, 45, .5); transition: transform .2s var(--ease); }
@media (hover: hover) { .fc .fc-event:hover { transform: translateY(-1px); } }
.fc .fc-list { border-radius: 18px; overflow: hidden; }
.fc .fc-list-day-cushion { background: var(--s2) !important; font-weight: 700; }
.fc .fc-more-link { font-weight: 700; color: var(--acc-tx); }
.fc .fc-popover { border-radius: 16px; overflow: hidden; box-shadow: 0 24px 48px -20px var(--shd2); }

/* --------------------------------------------------------------------------
   Couche mobile : cibles tactiles, zoom iOS, paysage
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  html { scrollbar-width: none; }
  html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
  .tp-btn-sm { min-height: 44px; }
  .tp-icon-btn.is-sm { width: 44px; height: 44px; }
  .tp-kpi { min-height: 138px; }
  .tp-kpi-num { font-size: 36px; }
  .fc .fc-button { min-height: 40px; min-width: 40px; }
  .fc .fc-toolbar-title { font-size: 18px !important; }
  .fc .fc-toolbar.fc-header-toolbar { flex-direction: column; align-items: stretch; }
  .fc .fc-toolbar-chunk { display: flex; justify-content: center; }
}
/* iOS zoome sur tout champ < 16 px : on garde 16 px sur les écrans tactiles. */
@media (pointer: coarse) {
  .tp-input, .tp-select, .tp-textarea, .tp-search input, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea { font-size: 16px !important; }
}
@media (max-height: 500px) and (orientation: landscape) and (max-width: 950px) {
  :root { --nav-h: 58px; }
  .tp-bn-item { height: 44px; }
}
@media (hover: none) {
  .fc .fc-event:hover { transform: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* --------------------------------------------------------------------------
   Abonnement : pastilles de verrou (fonctionnalités réservées à un plan)
   -------------------------------------------------------------------------- */
.tp-lock { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: none; margin-left: auto; border-radius: 50%; background: var(--amb-bg); color: var(--amb-tx); }
.tp-bn-item { position: relative; }
.tp-bn-item .tp-lock { position: absolute; top: 3px; left: calc(50% + 6px); margin: 0; width: 16px; height: 16px; background: var(--amb); color: #fff; box-shadow: 0 0 0 2px var(--s1, #fff); }

/* --------------------------------------------------------------------------
   Robustesse mobile : un contenu long (nom, lien, titre sans espace) ne doit
   jamais elargir la page.
   -------------------------------------------------------------------------- */
/* Une grille sans colonnes explicites a une colonne « auto », qui grandit avec
   son contenu le plus large et deborde de l'ecran. :where() = specificite nulle :
   toute classe Tailwind (grid-cols-N, lg:grid-cols-N...) reprend la main. */
:where(.grid) { grid-template-columns: minmax(0, 1fr); }
.tp-row-main, .tp-row-title, .tp-h1, .tp-h2, .tp-h3, .tp-quote, .tp-meta, .tp-card dd, .tp-card-flat dd, .tp-card-soft dd {
  overflow-wrap: anywhere;
  min-width: 0;
}
.tp-row > .tp-row-main { min-width: 0; }

/* Carte d'abonnement dans la barre latérale */
.tp-plancard { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 18px; background: var(--s1); border: 1px solid var(--line); color: var(--tx); text-decoration: none; transition: border-color .2s, transform .2s; }
.tp-plancard:hover { border-color: var(--acc); }
.tp-plancard b { font-size: 14px; }
