/* ==========================================================================
   Armée de Terre RBLX — feuille de style v2
   Interface claire et sobre (Trello / design de l'État) + animations soignées.
   Animations limitées à transform / opacity : fluide même sur petit PC.
   ========================================================================== */

@view-transition { navigation: auto; }

:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --column: #eef0f4;
  --column-line: #e1e5ec;
  --line: #e3e6ec;
  --line-strong: #c5cbd6;
  --ink: #1c2434;
  --ink-soft: #4b566b;
  --ink-mute: #7a8499;
  --primary: #28578f;
  --primary-hover: #1f4676;
  --primary-press: #173858;
  --primary-soft: #e8f0fa;
  --green: #1f8a5b;  --green-soft: #e3f6ec;
  --orange: #b45a09; --orange-soft: #fff1df;
  --red: #c5362b;    --red-soft: #fdebe9;
  --shadow-sm: 0 1px 2px rgba(20, 32, 56, .06), 0 0 0 1px rgba(20, 32, 56, .05);
  --shadow-md: 0 4px 12px -2px rgba(20, 32, 56, .10), 0 0 0 1px rgba(20, 32, 56, .06);
  --shadow-lg: 0 18px 38px -12px rgba(20, 32, 56, .28), 0 0 0 1px rgba(20, 32, 56, .07);
  --radius: 10px;
  --radius-lg: 14px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  position: relative; margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg);
  font-size: 14px; line-height: 1.5; color: var(--ink); -webkit-font-smoothing: antialiased;
}
/* halos très doux en arrière-plan, animés lentement */
body::before, body::after { position: fixed; z-index: -1; width: 46vmax; height: 46vmax; border-radius: 50%; content: ""; filter: blur(70px); opacity: .55; pointer-events: none; }
body::before { top: -18vmax; right: -12vmax; background: radial-gradient(circle, #dbe8fb, transparent 70%); animation: drift 22s ease-in-out infinite alternate; }
body::after  { bottom: -20vmax; left: -14vmax; background: radial-gradient(circle, #dff3ea, transparent 70%); animation: drift 28s ease-in-out infinite alternate-reverse; }
button, input, textarea, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; }
h2 { margin-bottom: 0; font-size: 16px; font-weight: 650; }
small { color: var(--ink-mute); font-size: 12px; }
.muted { color: var(--ink-mute); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
::selection { background: #cfe0f7; }

/* ---------- Keyframes ---------- */
@keyframes rise     { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fade     { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop      { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes drop-in  { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes drift    { to { transform: translate(5vmax, 4vmax) scale(1.12); } }
@keyframes pulse    { 0% { box-shadow: 0 0 0 0 rgba(31, 138, 91, .55); } 70% { box-shadow: 0 0 0 8px rgba(31, 138, 91, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 138, 91, 0); } }
@keyframes pulse-blue { 0% { box-shadow: 0 0 0 0 rgba(40, 87, 143, .5); } 70% { box-shadow: 0 0 0 7px rgba(40, 87, 143, 0); } 100% { box-shadow: 0 0 0 0 rgba(40, 87, 143, 0); } }
@keyframes sheen    { from { transform: translateX(-130%) skewX(-20deg); } to { transform: translateX(320%) skewX(-20deg); } }
@keyframes badge-pop { 0% { transform: scale(.3); } 65% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes float    { 50% { transform: translateY(-7px); } }
@keyframes ripple   { from { transform: scale(0); opacity: .35; } to { transform: scale(1); opacity: 0; } }
@keyframes loadbar  { 0% { transform: scaleX(0); opacity: 1; } 70% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes shine-line { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes wiggle   { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 55% { transform: rotate(10deg); } 80% { transform: rotate(-5deg); } }

/* barre de chargement en haut à chaque ouverture de page */
.load-bar { position: fixed; z-index: 100; top: 0; left: 0; right: 0; height: 3px; transform-origin: left; background: linear-gradient(90deg, #28578f, #3d8bd9, #4bce97); animation: loadbar 1s var(--ease) both; pointer-events: none; }

.page-content > *                 { animation: rise .6s var(--ease) both; }
.page-content > *:nth-child(2)    { animation-delay: .06s; }
.page-content > *:nth-child(3)    { animation-delay: .12s; }
.page-content > *:nth-child(4)    { animation-delay: .18s; }
.page-content > *:nth-child(n+5)  { animation-delay: .24s; }

/* ---------- En-tête (barre du haut) ---------- */
.app-shell { display: block; }
.topbar {
  position: sticky; z-index: 30; top: 0; display: flex; min-height: 64px; align-items: center; gap: 18px;
  padding: 0 clamp(14px, 2.4vw, 32px); border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  animation: drop-in .55s var(--ease) both;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 0; }
.brand-mark {
  display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 10px;
  background: linear-gradient(145deg, #e9f1fb, #d5e3f6); color: var(--primary); font-size: 13px; font-weight: 800; letter-spacing: -.02em;
  box-shadow: inset 0 0 0 1px rgba(40, 87, 143, .18); transition: transform .45s var(--spring), box-shadow .3s;
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.1); box-shadow: inset 0 0 0 1px rgba(40, 87, 143, .3), 0 6px 14px -4px rgba(40, 87, 143, .4); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; font-weight: 700; line-height: 1.25; }
.brand small { margin-top: 1px; font-size: 12px; }

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
.nav-link {
  position: relative; display: inline-flex; height: 38px; align-items: center; gap: 8px; padding: 0 13px; border-radius: 9px; overflow: hidden;
  color: var(--ink-soft); font-size: 14px; font-weight: 550; white-space: nowrap;
  transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
  animation: drop-in .5s var(--ease) both;
}
.nav-link:nth-child(2) { animation-delay: .05s; } .nav-link:nth-child(3) { animation-delay: .1s; }
.nav-link:nth-child(5) { animation-delay: .15s; } .nav-link:nth-child(6) { animation-delay: .2s; }
.nav-link::after { position: absolute; right: 14px; bottom: 5px; left: 14px; height: 2px; border-radius: 2px; background: var(--primary); content: ""; transform: scaleX(0); transition: transform .35s var(--ease); }
.nav-link:hover { background: var(--primary-soft); color: var(--primary); transform: translateY(-1px); }
.nav-link:hover::after { transform: scaleX(.55); }
.nav-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.nav-link.active::after { transform: scaleX(1); }
.nav-icon { font-size: 16px; line-height: 1; transition: transform .35s var(--spring); }
.nav-link:hover .nav-icon { transform: scale(1.25) rotate(-6deg); }
.nav-count { display: grid; min-width: 19px; height: 19px; place-items: center; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; animation: badge-pop .5s var(--spring) both; }
.nav-divider { width: 1px; height: 22px; margin: 0 8px; background: var(--line-strong); }

.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-notification { position: relative; display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); background: #fff; color: var(--ink-soft); font-size: 19px; transition: transform .3s var(--spring), box-shadow .25s, color .25s; }
.topbar-notification:hover { color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary), 0 6px 14px -6px rgba(40, 87, 143, .5); transform: translateY(-2px); animation: wiggle .6s ease; }
.topbar-notification i { position: absolute; top: -5px; right: -5px; display: grid; min-width: 18px; height: 18px; place-items: center; padding: 0 4px; border: 2px solid #fff; border-radius: 10px; background: var(--red); color: #fff; font-size: 10px; font-style: normal; font-weight: 700; animation: badge-pop .5s var(--spring) both; }
.profile-link { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 22px; transition: background .25s; }
.profile-link:hover { background: var(--column); }
.avatar { display: inline-grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #3a73b5, #28578f); color: #fff; font-size: 13px; font-weight: 700; transition: transform .35s var(--spring); }
.profile-link:hover .avatar { transform: scale(1.1) rotate(-6deg); }
.avatar-small { width: 24px; height: 24px; flex-basis: 24px; background: var(--primary-soft); color: var(--primary); font-size: 10px; box-shadow: inset 0 0 0 1px rgba(40, 87, 143, .2); }
.avatar-large { width: 52px; height: 52px; flex-basis: 52px; font-size: 19px; }
.profile-meta { display: grid; min-width: 0; line-height: 1.25; }
.profile-meta strong { font-size: 13px; font-weight: 650; white-space: nowrap; }
.profile-meta small { font-size: 11px; }
.logout-form { margin: 0; }
.text-button { padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--ink-mute); cursor: pointer; font-size: 13px; transition: color .2s, background .2s; }
.text-button:hover { background: var(--red-soft); color: var(--red); }
.mobile-menu { display: none; }

.main-content { min-height: calc(100vh - 64px); }
.page-content { width: 100%; max-width: 1640px; margin: 0 auto; padding: 30px clamp(14px, 2.4vw, 32px) 40px; }
.page-heading { margin: 0 0 22px; }
.page-heading p { margin: 0; color: var(--ink-mute); font-size: 14px; }
.heading-with-actions { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.eyebrow { margin-bottom: 6px; color: var(--ink-mute); font-size: 12px; font-weight: 500; }
.eyebrow b { margin: 0 4px; font-weight: 400; opacity: .6; }
.eyebrow strong { color: var(--ink); font-weight: 650; }
.live-dot { display: inline-block; width: 9px; height: 9px; margin: 0 0 6px 8px; border-radius: 50%; background: #2fbf84; animation: pulse 2s infinite; }
.app-footer { display: flex; justify-content: space-between; gap: 12px; padding: 0 clamp(14px, 2.4vw, 32px) 18px; color: var(--ink-mute); font-size: 12px; }

/* ---------- Boutons ---------- */
.button {
  position: relative; display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 8px; padding: 0 16px;
  overflow: hidden; border: 0; border-radius: 9px; cursor: pointer; font-size: 14px; font-weight: 650; text-decoration: none; white-space: nowrap;
  transition: background .25s var(--ease), box-shadow .3s var(--ease), transform .3s var(--spring), color .2s;
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0) scale(.96); transition-duration: .08s; }
.button:disabled { cursor: wait; opacity: .6; transform: none; }
.button::after { position: absolute; top: 0; bottom: 0; left: 0; width: 35%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); content: ""; transform: translateX(-130%) skewX(-20deg); pointer-events: none; }
.button:hover::after { animation: sheen .8s var(--ease); }
.button-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(20, 32, 56, .25); }
.button-primary:hover { background: var(--primary-hover); box-shadow: 0 10px 20px -8px rgba(40, 87, 143, .75); }
.button-primary:active { background: var(--primary-press); }
.button-secondary { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.button-secondary:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--primary), 0 8px 16px -10px rgba(20, 32, 56, .5); color: var(--primary); }
.button-danger-outline { background: #fff; color: var(--red); box-shadow: inset 0 0 0 1px #f0bfba; }
.button-danger-outline:hover { background: var(--red); color: #fff; box-shadow: 0 10px 20px -8px rgba(197, 54, 43, .7); }
.button-small { min-height: 30px; padding: 0 11px; font-size: 13px; }
.button-wide { width: 100%; }
.button-wide span { margin-left: auto; transition: transform .3s var(--ease); }
.button-wide:hover span { transform: translateX(5px); }
.ripple { position: absolute; z-index: 1; border-radius: 50%; background: currentColor; pointer-events: none; animation: ripple .6s ease-out forwards; }

/* ---------- Filtres ---------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.search-box { display: flex; min-width: 210px; height: 38px; flex: 1 1 260px; align-items: center; gap: 8px; padding: 0 12px; border-radius: 9px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink-mute); transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.search-box:hover { box-shadow: inset 0 0 0 1px var(--ink-mute); }
.search-box:focus-within { box-shadow: inset 0 0 0 2px var(--primary), 0 8px 18px -10px rgba(40, 87, 143, .6); color: var(--primary); transform: translateY(-1px); }
.search-box span { font-size: 18px; }
.search-box input { width: 100%; min-height: 0 !important; padding: 0 !important; border: 0 !important; outline: 0; background: transparent !important; box-shadow: none !important; color: var(--ink); font-size: 14px; }
.filter-bar select { width: auto; min-width: 150px; height: 38px; min-height: 38px; cursor: pointer; }
.clear-filters { padding: 8px 4px; color: var(--primary); font-size: 13px; font-weight: 600; }
.clear-filters:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Kanban ---------- */
.board-scroll { overflow-x: auto; padding: 4px 2px 14px; margin: 0 -2px; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
.kanban-board { display: grid; min-width: 720px; grid-auto-columns: minmax(270px, 1fr); grid-auto-flow: column; align-items: start; gap: 14px; }
.kanban-column { min-width: 270px; border-radius: var(--radius-lg); background: var(--column); box-shadow: inset 0 0 0 1px var(--column-line); animation: rise .65s var(--ease) both; }
.kanban-column:nth-child(2) { animation-delay: .08s; } .kanban-column:nth-child(3) { animation-delay: .16s; }
.kanban-column:nth-child(4) { animation-delay: .24s; } .kanban-column:nth-child(n+5) { animation-delay: .32s; }
.column-header { display: flex; min-height: 50px; align-items: center; gap: 9px; padding: 0 14px; }
.column-header h2 { flex: 1; font-size: 14px; font-weight: 700; }
.column-indicator { width: 10px; height: 10px; border-radius: 50%; background: var(--label-color, #8590a2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--label-color, #8590a2) 22%, transparent); transition: transform .4s var(--spring); }
.kanban-column:hover .column-indicator { transform: scale(1.35); }
.column-count { display: grid; min-width: 26px; height: 24px; place-items: center; padding: 0 7px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--column-line); color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.column-dropzone { display: grid; min-height: 96px; align-content: start; gap: 10px; margin: 0 8px 8px; padding: 2px 0 4px; border-radius: 10px; transition: background .25s var(--ease), box-shadow .25s var(--ease); }
.column-dropzone.drop-active { background: rgba(40, 87, 143, .07); box-shadow: inset 0 0 0 2px rgba(40, 87, 143, .45); }
.column-empty { padding: 24px 6px; color: var(--ink-mute); font-size: 13px; text-align: center; }

.task-card {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 0%;
  position: relative; min-width: 0; overflow: hidden; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: box-shadow .35s var(--ease), transform .35s var(--ease), opacity .2s;
  animation: rise .55s var(--ease) both;
}
.task-card:nth-child(2) { animation-delay: .05s; } .task-card:nth-child(3) { animation-delay: .1s; }
.task-card:nth-child(4) { animation-delay: .15s; } .task-card:nth-child(5) { animation-delay: .2s; } .task-card:nth-child(n+6) { animation-delay: .25s; }
/* halo lumineux qui suit la souris */
.task-card::before { position: absolute; inset: 0; z-index: 0; background: radial-gradient(240px circle at var(--mx) var(--my), rgba(61, 139, 217, .13), transparent 65%); content: ""; opacity: 0; transition: opacity .3s; pointer-events: none; }
.task-card:hover::before { opacity: 1; }
.task-card > * { position: relative; z-index: 1; }
.task-card[draggable=true] { cursor: grab; }
.task-card[draggable=true]:active { cursor: grabbing; }
.task-card:hover { box-shadow: var(--shadow-lg); transform: perspective(900px) translateY(-4px) rotateX(var(--rx)) rotateY(var(--ry)); }
.task-card.is-dragging { opacity: .6; box-shadow: var(--shadow-lg); transform: rotate(3deg) scale(1.03); }
.task-card-link { display: block; padding: 12px 14px 6px; }
.task-badge {
  display: inline-flex; max-width: 100%; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; overflow: hidden; border-radius: 5px;
  background: color-mix(in srgb, var(--label-color, #8590a2) 16%, #fff);
  color: color-mix(in srgb, var(--label-color, #44546f) 50%, #1c2434);
  font-size: 10.5px; font-weight: 750; letter-spacing: .05em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap;
}
.task-badge::before { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--label-color, #8590a2); content: ""; }
.task-card h3 { margin: 9px 0 4px; font-size: 14.5px; font-weight: 700; line-height: 1.4; transition: color .25s; }
.task-card:hover h3 { color: var(--primary); }
.task-excerpt { margin: 0; color: var(--ink-mute); font-size: 12.5px; line-height: 1.5; }
.task-card-meta { display: flex; min-height: 42px; align-items: center; gap: 8px; margin: 6px 14px 0; padding: 0 0 2px; border-top: 1px solid var(--line); color: var(--ink-mute); font-size: 12px; }
.assignee { display: flex; min-width: 0; flex: 1; align-items: center; gap: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due-date { padding: 2px 7px; border-radius: 5px; background: var(--column); color: var(--ink-soft); font-weight: 600; white-space: nowrap; }
.due-date.overdue { background: var(--red-soft); color: var(--red); }
.response-pending { padding: 2px 7px; border-radius: 5px; background: var(--orange-soft); color: var(--orange); font-size: 11px; font-weight: 650; white-space: nowrap; }
.board-footnote { display: flex; align-items: center; gap: 8px; padding-top: 10px; color: var(--ink-mute); font-size: 13px; }
.drag-indicator { font-size: 15px; animation: float 3s ease-in-out infinite; }

/* ---------- Panneaux ---------- */
.panel { padding: 22px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); transition: box-shadow .35s var(--ease), transform .35s var(--ease); }
.panel:hover { box-shadow: var(--shadow-md); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.count-pill { display: inline-grid; min-width: 24px; height: 20px; margin-left: 6px; place-items: center; padding: 0 7px; border-radius: 10px; background: var(--column); color: var(--ink-soft); font-size: 12px; font-weight: 650; vertical-align: middle; }
.subtle-link { color: var(--primary); font-size: 13px; font-weight: 600; }
.subtle-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.empty-state { display: grid; min-height: 300px; justify-items: center; align-content: center; padding: 36px; border: 2px dashed var(--line-strong); border-radius: var(--radius-lg); background: rgba(255, 255, 255, .6); text-align: center; }
.empty-mark { display: grid; width: 54px; height: 54px; margin-bottom: 16px; place-items: center; border-radius: 15px; background: var(--primary-soft); color: var(--primary); font-size: 21px; animation: float 3.4s ease-in-out infinite; }
.empty-state h2, .empty-state h1 { margin-bottom: 6px; font-size: 18px; }
.empty-state h1 { font-size: 22px; }
.empty-state p { max-width: 400px; margin-bottom: 0; color: var(--ink-mute); font-size: 14px; line-height: 1.6; }
.error-state .button { margin-top: 18px; }

.proposal-list { display: grid; gap: 10px; }
.proposal-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; align-items: start; gap: 18px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .35s var(--ease), box-shadow .35s var(--ease); animation: rise .55s var(--ease) both; }
.proposal-row:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.proposal-row:nth-child(2) { animation-delay: .06s; } .proposal-row:nth-child(3) { animation-delay: .12s; } .proposal-row:nth-child(n+4) { animation-delay: .18s; }
.proposal-main { min-width: 0; }
.proposal-title { font-size: 15px; font-weight: 700; transition: color .2s; }
.proposal-title:hover { color: var(--primary); }
.proposal-main p { margin: 6px 0 10px; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.proposal-state { display: inline-flex; width: fit-content; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 5px; background: var(--column); color: var(--ink-soft); font-size: 12px; font-weight: 700; white-space: nowrap; }
.state-pending { background: var(--orange-soft); color: var(--orange); }
.state-accepted { background: var(--green-soft); color: var(--green); }
.state-rejected { background: var(--red-soft); color: var(--red); }
.proposal-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--ink-mute); font-size: 12px; }
.decision-note { margin-top: 10px; padding: 8px 12px; border-left: 3px solid var(--primary); border-radius: 0 7px 7px 0; background: var(--primary-soft); font-size: 13px; line-height: 1.5; }

/* ---------- Tâche ---------- */
.task-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--primary); font-size: 13px; font-weight: 600; transition: transform .3s var(--ease); }
.back-link:hover { transform: translateX(-5px); }
.task-heading-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; color: var(--ink-mute); font-size: 13px; }
.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 330px); align-items: start; gap: 16px; }
.task-primary, .task-aside { display: grid; align-content: start; gap: 16px; }
.task-aside { position: sticky; top: 82px; }
.description-body { font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.task-properties dl { display: grid; margin: 0; }
.task-properties dl div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.task-properties dt { color: var(--ink-mute); font-size: 13px; }
.task-properties dd { max-width: 65%; margin: 0; font-size: 13px; font-weight: 600; text-align: right; }
.status-form { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.status-form label { display: grid; gap: 6px; }
.attachment-list { display: grid; }
.attachment-item { display: flex; min-width: 0; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); transition: transform .3s var(--ease); }
.attachment-item:hover { transform: translateX(4px); }
.attachment-item:first-child { padding-top: 0; border-top: 0; }
.attachment-icon { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-size: 15px; }
.image-preview { display: grid; width: 48px; height: 40px; flex: 0 0 48px; place-items: center; overflow: hidden; border-radius: 7px; background: var(--column); }
.image-preview img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.attachment-item:hover .image-preview img { transform: scale(1.15); }
.attachment-name { display: grid; min-width: 0; flex: 1; }
.attachment-name strong { overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.attachment-name small { font-size: 12px; }
.icon-button { position: relative; display: inline-grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; overflow: hidden; border: 0; border-radius: 8px; background: transparent; color: var(--ink-mute); cursor: pointer; font-size: 20px; transition: background .2s, color .2s, transform .3s var(--spring); }
.icon-button:hover { background: var(--red-soft); color: var(--red); transform: scale(1.12); }
.icon-button:active { transform: scale(.9); }
.empty-inline { margin: 0; color: var(--ink-mute); font-size: 13px; }
.comment-list { display: grid; gap: 14px; }
.comment-item { display: flex; align-items: start; gap: 10px; animation: rise .5s var(--ease) both; }
.comment-item > div { min-width: 0; flex: 1; padding: 10px 14px; border-radius: 4px 12px 12px 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.comment-meta { display: flex; align-items: baseline; gap: 10px; }
.comment-meta strong { font-size: 13px; }
.comment-meta time { color: var(--ink-mute); font-size: 12px; }
.comment-item p { margin: 4px 0 0; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.comment-form { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.comment-submit { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.comment-submit span { color: var(--ink-mute); font-size: 12px; }
.activity-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.activity-list li { position: relative; display: grid; grid-template-columns: 10px 1fr; gap: 10px; }
.activity-point { position: relative; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.activity-list li:not(:last-child) .activity-point::after { position: absolute; top: 12px; left: 3px; width: 2px; height: 36px; background: var(--line); content: ""; }
.activity-list strong { display: block; font-size: 13px; font-weight: 550; line-height: 1.5; }
.activity-list small { display: block; margin-top: 2px; font-size: 12px; }
.notice-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; border-radius: var(--radius); background: var(--primary-soft); box-shadow: inset 4px 0 0 var(--primary); }
.notice-panel strong { display: block; font-size: 14px; }
.notice-panel p { margin: 3px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.assignment-notice { background: var(--orange-soft); box-shadow: inset 4px 0 0 #e56910; }
.proposal-review { display: grid; align-items: start; }
.decision-form { display: grid; width: 100%; gap: 10px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.decision-form .inline-actions { justify-content: flex-end; }
.compact-form { gap: 12px !important; }

/* ---------- Formulaires ---------- */
input, textarea, select { min-width: 0; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), textarea, select {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 9px; outline: none; background: #fff; color: var(--ink); font-size: 14px;
  box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow .25s var(--ease), background .2s, transform .25s var(--ease);
}
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]):hover, textarea:hover, select:hover { box-shadow: inset 0 0 0 1px var(--ink-mute); }
input[type=color] { width: 44px; height: 38px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; cursor: pointer; }
input[type=file] { width: 100%; color: var(--ink-mute); font-size: 12px; }
input[type=file]::file-selector-button { margin-right: 10px; padding: 7px 12px; border: 0; border-radius: 7px; background: var(--column); color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 650; transition: background .2s; }
input[type=file]::file-selector-button:hover { background: var(--column-line); }
input:focus, textarea:focus, select:focus { background: #fff !important; box-shadow: inset 0 0 0 2px var(--primary), 0 8px 18px -12px rgba(40, 87, 143, .7) !important; }
input:disabled { opacity: .6; }
select { cursor: pointer; }
textarea { resize: vertical; line-height: 1.55; }
label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 13px; font-weight: 650; }
label small { font-size: 12px; font-weight: 400; }
.stack-form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-note { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--primary-soft); color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* ---------- Tableaux ---------- */
.table-panel { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
.data-table th { padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--ink-mute); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.data-table td { padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.data-table tbody tr { transition: background .2s, box-shadow .2s; animation: fade .5s var(--ease) both; }
.data-table tbody tr:nth-child(2) { animation-delay: .04s; } .data-table tbody tr:nth-child(3) { animation-delay: .08s; } .data-table tbody tr:nth-child(n+4) { animation-delay: .12s; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.table-person { display: inline-flex; align-items: center; gap: 10px; }
.table-person strong { font-size: 14px; font-weight: 650; }
.mono { color: var(--ink-mute) !important; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12px !important; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.status-pill i { width: 8px; height: 8px; border-radius: 50%; background: #2fbf84; }
.status-active i { animation: pulse 2.4s infinite; }
.status-inactive i { background: #9aa3b5; }
.status-active { color: var(--green) !important; }
.status-inactive { color: var(--ink-mute) !important; }
.table-action { text-align: right !important; }
.table-actions { display: flex; justify-content: flex-end; gap: 14px; }
.table-note { padding: 12px 18px; border-top: 1px solid var(--line); color: var(--ink-mute); font-size: 13px; }

/* ---------- Étiquettes ---------- */
.labels-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 16px; }
.label-admin-list { display: grid; gap: 10px; }
.label-admin-row { display: grid; gap: 8px; padding: 12px; border-radius: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .25s, transform .3s var(--ease); }
.label-admin-row:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-md); }
.label-edit-form { display: flex; align-items: center; gap: 8px; }
.terminal-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 12px; font-weight: 650; white-space: nowrap; }
.terminal-toggle input[type=checkbox] { accent-color: var(--green); }
.label-edit-form input[name=name] { flex: 1; }
.color-chip { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: var(--label-color); }
.label-delete-form { display: flex; justify-content: flex-end; gap: 8px; }
.label-delete-form select { width: min(230px, 60%); min-height: 32px; padding: 4px 8px; font-size: 13px; }
.label-create-panel { align-self: start; }
.label-create-panel input[type=color] { width: 100%; height: 42px; }

/* ---------- Notifications ---------- */
.notification-list { display: grid; overflow: hidden; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.notification-row { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line); background: var(--surface); transition: background .25s, transform .3s var(--ease); animation: rise .5s var(--ease) both; }
.notification-row:nth-child(2) { animation-delay: .05s; } .notification-row:nth-child(3) { animation-delay: .1s; } .notification-row:nth-child(n+4) { animation-delay: .15s; }
.notification-row:hover { background: var(--surface-2); transform: translateX(4px); }
.notification-row:last-child { border-bottom: 0; }
.notification-row.is-unread { background: var(--primary-soft); }
.notification-row.is-unread:hover { background: #dce9f8; }
.notification-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--primary); }
.is-unread .notification-dot { animation: pulse-blue 2s infinite; }
.is-read .notification-dot { background: var(--line-strong); }
.notification-content { display: grid; min-width: 0; flex: 1; gap: 3px; }
.notification-content strong { font-size: 14px; font-weight: 550; }
.notification-content small { font-size: 12px; }
.notification-content small a { color: var(--primary); font-weight: 600; }
.notification-content small a:hover { text-decoration: underline; }

/* ---------- Profil ---------- */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 16px; max-width: 980px; }
.profile-summary { display: flex; align-items: center; gap: 14px; margin: 0 0 20px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.profile-summary div { display: grid; gap: 2px; }
.profile-summary strong { font-size: 16px; }
.profile-summary small { font-size: 13px; }

/* ---------- Messages, toasts, dialogues ---------- */
.flash { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 16px clamp(14px, 2.4vw, 32px) 0; padding: 12px 16px; border-radius: 10px; background: var(--green-soft); box-shadow: inset 4px 0 0 var(--green); color: #0d4d33; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; animation: drop-in .5s var(--ease) both; }
.flash-error { background: var(--red-soft); box-shadow: inset 4px 0 0 var(--red); color: #7a1f17; }
.flash button { flex: 0 0 auto; border: 0; background: none; color: inherit; cursor: pointer; font-size: 18px; transition: transform .3s var(--spring); }
.flash button:hover { transform: rotate(90deg) scale(1.2); }
.auth-wrap .flash { max-width: 400px; margin: 0 auto 14px; }
.client-toast { position: fixed; z-index: 80; right: 22px; bottom: 22px; max-width: min(380px, calc(100vw - 36px)); padding: 13px 18px; transform: translateY(18px) scale(.95); border-radius: 10px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease), transform .45s var(--spring); }
.client-toast.visible { transform: none; opacity: 1; }
.client-toast[data-kind=error] { background: var(--red); }

.app-dialog { width: min(580px, calc(100vw - 28px)); max-height: calc(100dvh - 30px); padding: 24px; overflow: auto; border: 0; border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 30px 70px -12px rgba(20, 32, 56, .5), 0 0 0 1px rgba(20, 32, 56, .08); }
.app-dialog[open] { animation: pop .45s var(--spring) both; }
.app-dialog::backdrop { background: rgba(20, 32, 56, .5); backdrop-filter: blur(4px); }
.app-dialog[open]::backdrop { animation: fade .35s ease both; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.dialog-heading .eyebrow { color: var(--primary); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dialog-heading h2 { font-size: 21px; font-weight: 750; }
.dialog-heading .icon-button { font-size: 24px; }
.dialog-heading .icon-button:hover { background: var(--column); color: var(--ink); transform: rotate(90deg) scale(1.1); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }

/* ---------- Connexion ---------- */
.auth-shell { display: grid; min-height: 100vh; place-items: center; overflow-x: hidden; }
.auth-wrap { width: 100%; padding: 28px 20px; }
.login-card { position: relative; width: min(100%, 410px); margin: 0 auto; padding: 38px; overflow: hidden; border-radius: 18px; background: #fff; box-shadow: var(--shadow-lg); animation: pop .8s var(--spring) both; }
.login-card::before { position: absolute; top: 0; right: 0; left: 0; height: 4px; background: linear-gradient(90deg, #28578f, #3d8bd9, #4bce97, #3d8bd9, #28578f); background-size: 200% 100%; content: ""; animation: shine-line 6s linear infinite; }
.brand-auth { padding: 0 0 24px; }
.brand-auth .brand-mark { width: 46px; height: 46px; flex-basis: 46px; }
.login-card .eyebrow { margin-bottom: 8px; color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.login-card h1 { margin-bottom: 6px; font-size: 28px; }
.login-card > p { margin-bottom: 24px; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.login-card .stack-form { gap: 16px; }
.login-card input { min-height: 44px !important; }
.login-card .button { min-height: 44px; margin-top: 4px; }
.login-card .stack-form > *, .login-card .brand-auth, .login-card h1 { animation: rise .6s var(--ease) both; }
.login-card .stack-form > *:nth-child(3) { animation-delay: .1s; } .login-card .stack-form > *:nth-child(4) { animation-delay: .18s; } .login-card .stack-form > *:nth-child(5) { animation-delay: .26s; }
.login-note { display: flex; align-items: center; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-mute); font-size: 12px; }
.lock-mark { color: var(--green); font-size: 12px; }
.auth-credits { margin-top: 22px; color: var(--ink-mute); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-align: center; animation: fade 1s .4s both; }
.auth-credits span { margin: 0 4px; }
.narrow-heading, .narrow-panel { max-width: 600px; }
.narrow-panel { margin-top: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .brand-text small, .profile-meta { display: none; }
  .task-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .kanban-board { grid-auto-columns: minmax(245px, 1fr); }
  .kanban-column { min-width: 245px; }
}
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding-top: 8px; padding-bottom: 8px; }
  .mobile-menu { display: grid; order: 3; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 10px; background: var(--column); cursor: pointer; font-size: 16px; transition: transform .3s var(--spring); }
  .mobile-menu:active { transform: scale(.9); }
  .top-actions { order: 2; }
  .main-nav { display: none; order: 4; width: 100%; flex-direction: column; align-items: stretch; margin: 0; padding-bottom: 8px; }
  .menu-open .main-nav { display: flex; }
  .main-nav .nav-link { height: 42px; }
  .nav-divider { width: auto; height: 1px; margin: 4px 0; }
  .task-layout { grid-template-columns: 1fr; }
  .task-aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-properties { grid-row: span 2; }
  .history-panel { grid-column: 1 / -1; }
  .labels-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .page-content { padding: 22px 14px 34px; }
  .heading-with-actions { align-items: flex-start; flex-direction: column; }
  .heading-with-actions > .button, .heading-with-actions > form { align-self: stretch; }
  .filter-bar { display: grid; grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .filter-bar select { min-width: 0; width: 100%; }
  .filter-bar .button { width: 100%; }
  .clear-filters { justify-self: center; }
  .kanban-board { grid-auto-columns: minmax(82vw, 1fr); min-width: 0; gap: 10px; }
  .kanban-column { min-width: 0; }
  .app-footer { flex-direction: column; gap: 4px; padding: 0 14px 16px; }
  .proposal-row { grid-template-columns: 1fr; gap: 10px; padding: 14px; }
  .proposal-row > .button { justify-self: start; }
  .task-heading { align-items: flex-start; flex-direction: column; }
  .task-heading > form { align-self: flex-end; }
  .task-aside { grid-template-columns: 1fr; }
  .task-properties { grid-row: auto; }
  .history-panel { grid-column: auto; }
  .notice-panel { align-items: flex-start; flex-direction: column; }
  .decision-form .inline-actions { justify-content: flex-start; }
  .form-grid, .profile-grid { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .label-edit-form { flex-wrap: wrap; }
  .label-edit-form input[name=name] { flex: 1 1 calc(100% - 20px); }
  .label-delete-form { flex-wrap: wrap; justify-content: flex-start; }
  .label-delete-form select { width: 100%; }
  .notification-row { align-items: flex-start; padding: 13px; }
  .notification-row > form { align-self: center; }
  .login-card { padding: 28px 22px; }
  .text-button { padding: 6px 4px; }
}

/* Accessibilité : animations réduites si demandé par l'appareil */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; }
}
