<?php $h=static fn($v)=>htmlspecialchars((string)$v,ENT_QUOTES,'UTF-8'); ?>
<style>.dt-head{display:flex;justify-content:space-between;gap:1rem;align-items:center;margin-bottom:1.2rem}.dt-head h2{margin:.2rem 0}.dt-grid{display:grid;gap:.8rem}.dt-card{display:grid;grid-template-columns:auto 1fr auto;gap:1rem;align-items:center;padding:1rem 1.1rem;border:1px solid #dbe3f0;border-radius:14px;background:#fff;text-decoration:none;color:#13213c}.dt-card>span{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:#eef4ff;color:#155ec8;font-size:1.2rem}.dt-card strong,.dt-card small{display:block}.dt-card small{margin-top:.2rem;color:#64748b}.dt-card:hover{border-color:#88ace2;box-shadow:0 8px 22px #1f477018}.dt-empty{padding:2rem;text-align:center;background:#fff;border:1px solid #dbe3f0;border-radius:14px;color:#52627a}@media(max-width:650px){.dt-head{align-items:flex-start;flex-direction:column}.dt-card{grid-template-columns:auto 1fr}}</style>
<section class="dt-head"><div><span class="page-kicker">Direction</span><h2>Tâches à valider</h2><p>Plannings, comptes rendus de télétravail et demandes de déplacement en attente.</p></div><a class="button button-secondary" href="/public/espaces?espace=direction">Retour</a></section>
<?php if(!$tasks):?><div class="dt-empty"><strong>Aucune tâche en attente</strong><p>Les nouvelles demandes apparaîtront automatiquement ici.</p></div><?php else:?><section class="dt-grid"><?php foreach($tasks as$task):?><a class="dt-card" href="<?=$h($task['url'])?>"><span><?=$task['kind']==='teletravail'?'⌂':($task['kind']==='planning'?'✓':'↔')?></span><div><strong><?=$h($task['title'])?></strong><small><?=$h($task['text'])?></small></div><b>Ouvrir →</b></a><?php endforeach?></section><?php endif?>
