/* Arc CRM – custom styles */

/* ── Composants réutilisables (2026-09-02, refonte densité/aération) ────
   Tailwind tourne en mode Play CDN (<script src="cdn.tailwindcss.com">,
   layouts/app.php) : il compile à la volée les classes UTILITAIRES
   trouvées dans le HTML, mais ne traite JAMAIS ce fichier CSS à travers
   son moteur JIT — une directive @apply y serait donc inerte. Déclarations
   ordinaires ci-dessous, valeurs alignées sur les utilitaires Tailwind
   déjà omniprésents (rounded-xl/shadow-sm/border-gray-100) pour rester
   visuellement continu avec les vues pas encore migrées vers ces classes.
   But : remplacer le mélange ad hoc p-4/p-5/p-6 trouvé sur les cartes
   d'une même page par UN SEUL padding cohérent, choisi une fois pour
   toutes plutôt qu'accidentellement. */
.arc-card {
  background: #fff;
  border-radius: 0.75rem;         /* = rounded-xl */
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);   /* = shadow-sm */
  border: 1px solid #f3f4f6;      /* = border-gray-100 */
  padding: 1.25rem;                /* = p-5, carte de contenu standard */
}
/* Variante tuile KPI/stat : padding réduit DÉLIBÉRÉMENT (pas un oubli) —
   garde la distinction visuelle carte-de-contenu vs indicateur-chiffré. */
.arc-card-tight {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  border: 1px solid #f3f4f6;
  padding: 1rem;                   /* = p-4 */
}

/* Smooth scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Sidebar transition on mobile */
#sidebar { transition: transform 0.3s cubic-bezier(.4,0,.2,1); }

/* Line clamp utility */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Toast animations */
@keyframes slideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes slideOutRight {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(110%); opacity: 0; }
}
.toast-enter { animation: slideInRight 0.35s ease forwards; }
.toast-leave { animation: slideOutRight 0.3s ease forwards; }

/* Pulse badge */
@keyframes pulseBadge {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.2); }
}
.badge-pulse { animation: pulseBadge 0.6s ease 2; }

/* Table hover */
tbody tr { transition: background-color 0.15s; }

/* Modal backdrop */
.modal-bg { backdrop-filter: blur(2px); }

/* Focus ring override to match brand */
input:focus, select:focus, textarea:focus {
  outline: none;
}

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.fa-spinner { animation: spin 1s linear infinite; }

/* ── Bannière permission notifications ─────────────────── */
@keyframes slideDown {
  from { transform: translateX(-50%) translateY(-120%); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);     opacity: 1; }
}
.notif-banner { animation: slideDown 0.4s cubic-bezier(.34,1.56,.64,1) forwards; }

/* ── Flash onglet au clic notification ──────────────────── */
@keyframes flashBg {
  0%, 100% { background-color: transparent; }
  50%       { background-color: rgba(57,181,74,0.08); }
}
body.notif-flash { animation: flashBg 0.6s ease 2; }

/* ── Notification Panel (overlay Arc CRM branded) ───────── */
#notifPanelContainer {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  width: 360px;
  max-width: calc(100vw - 32px);
}

@keyframes notifSlideIn {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes notifSlideOut {
  from { transform: translateX(0);    opacity: 1; max-height: 200px; margin-bottom: 0; }
  to   { transform: translateX(110%); opacity: 0; max-height: 0;     margin-bottom: -10px; }
}

.notif-panel-card {
  pointer-events: all;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(46,58,140,.18), 0 2px 8px rgba(0,0,0,.08);
  overflow: hidden;
  animation: notifSlideIn 0.38s cubic-bezier(.34,1.4,.64,1) forwards;
  border-left: 4px solid #39B54A;
}
.notif-panel-card.leaving {
  animation: notifSlideOut 0.3s ease forwards;
}

/* En-tête */
.notif-panel-head {
  background: #0b1029;
  color: #fff;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.notif-panel-head .nph-logo {
  width: 22px; height: 22px;
  background: #39B54A;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; color: #fff;
  flex-shrink: 0;
}
.notif-panel-head .nph-title {
  font-size: 12px; font-weight: 700; letter-spacing: .03em; flex: 1;
}
.notif-panel-head .nph-time {
  font-size: 10px; opacity: .65;
}
.notif-panel-head .nph-close {
  background: none; border: none; color: rgba(255,255,255,.7);
  cursor: pointer; padding: 2px 4px; border-radius: 4px; font-size: 13px;
  transition: color .15s;
}
.notif-panel-head .nph-close:hover { color: #fff; }

/* Corps */
.notif-panel-body {
  padding: 12px 14px 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.notif-panel-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: #EEF2FF;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 15px; color: #0b1029;
}
.notif-panel-icon.type-assignation { background:#EEF2FF; color:#0b1029; }
.notif-panel-icon.type-rapport     { background:#FEF3C7; color:#D97706; }
.notif-panel-icon.type-conge       { background:#D1FAE5; color:#059669; }
.notif-panel-icon.type-rappel      { background:#FEE2E2; color:#DC2626; }
.notif-panel-icon.type-info,
.notif-panel-icon.type-message     { background:#E0F2FE; color:#0284C7; }

.notif-panel-msg {
  flex: 1;
  font-size: 13px;
  color: #1f2937;
  line-height: 1.45;
}
.notif-panel-msg strong { display: block; font-weight: 600; color: #111827; margin-bottom: 2px; }

/* Pied */
.notif-panel-foot {
  padding: 8px 14px 10px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.notif-panel-foot button {
  padding: 5px 14px; border-radius: 7px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: none; transition: opacity .15s;
}
.notif-panel-foot .btn-voir   { background: #0b1029; color: #fff; }
.notif-panel-foot .btn-voir:hover   { opacity: .85; }
.notif-panel-foot .btn-fermer { background: #F3F4F6; color: #6B7280; }
.notif-panel-foot .btn-fermer:hover { background: #E5E7EB; }

/* Barre de progression */
.notif-panel-progress {
  height: 3px; background: #E5E7EB; position: relative; overflow: hidden;
}
.notif-panel-progress-bar {
  position: absolute; top: 0; left: 0; height: 100%;
  background: linear-gradient(90deg, #39B54A, #0b1029);
  transition: width linear;
}

/* 2026-09-26 (audit tablette 768 px) : tuiles « icône + chiffre + libellé » — le bloc texte peut rétrécir et un libellé long
   (« Nouvelles candidatures », « Permissions ») passe à la ligne au lieu de sortir de la carte. */
.arc-card.flex > div:last-child, .arc-card-tight.flex > div:last-child { min-width: 0; }
.arc-card p, .arc-card-tight p { overflow-wrap: break-word; }

/* ══════════════════════════════════════════════════════════════════════════
   ÉPURATION VISUELLE — 2026-09-30, demande du DG : « les interfaces sont trop
   chargées, je veux quelque chose de plus épuré, soft et pro ».

   Principe : agir sur les MOTIFS partagés par toutes les vues plutôt que de
   retoucher 293 fichiers. Aucune couleur de marque n'est changée, aucune
   information n'est retirée — on baisse seulement le bruit : bordures moins
   dures, ombres plus douces, pastilles moins criardes, en-têtes de tableau
   discrets, chiffres alignés. Les vues non encore reprises en profitent
   immédiatement et restent cohérentes avec celles qui le seront.
   ══════════════════════════════════════════════════════════════════════════ */

/* Fond de page très légèrement teinté : les cartes blanches se détachent
   d'elles-mêmes, ce qui permet d'alléger leurs bordures juste en dessous. */
body.bg-gray-100 { background-color: #f4f5f7; }

/* Cartes : la bordure dure + l'ombre faisaient double emploi. On garde une
   ombre douce et une bordure presque invisible — l'effet « soft ». */
.arc-card,
.arc-card-tight {
  border-color: rgb(17 24 39 / 0.06);
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.04), 0 1px 3px rgb(16 24 40 / 0.03);
}

/* Même traitement pour les cartes écrites à la main (motif très répandu dans
   les vues : bg-white + rounded-xl + shadow-sm), sans toucher aux boutons ni
   aux menus, qui ne portent pas `rounded-xl`. */
.bg-white.rounded-xl.shadow-sm {
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.04), 0 1px 3px rgb(16 24 40 / 0.03);
}

/* En-têtes de tableau : discrets et lisibles plutôt que gras et sombres. */
table thead th {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #6b7280;
}
/* Les colonnes de chiffres s'alignent verticalement (largeur de chiffre fixe) :
   c'est ce qui distingue le plus nettement un tableau « pro » d'un tableau brut. */
table td, table th { font-variant-numeric: tabular-nums; }

/* Pastilles (rôles, statuts, étiquettes) : elles sont nombreuses par nature.
   On abaisse leur poids visuel sans toucher à leur couleur, donc sans perdre
   le code couleur auquel les équipes sont habituées. */
.rounded-full.text-xs,
.rounded.text-xs,
.rounded-full.text-\[10px\],
.rounded-full.text-\[11px\] {
  font-weight: 500;
}

/* Séparateurs de lignes plus doux : le gris par défaut « découpe » la page. */
.divide-gray-100 > :not([hidden]) ~ :not([hidden]) { border-color: rgb(17 24 39 / 0.05); }
.divide-gray-200 > :not([hidden]) ~ :not([hidden]) { border-color: rgb(17 24 39 / 0.07); }

/* Repère de focus clavier homogène et visible partout (accessibilité) —
   il n'existait que là où Tailwind l'avait été posé à la main. */
a:focus-visible, button:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid rgb(37 99 235 / 0.55);
  outline-offset: 2px;
}

/* Respiration : un peu plus d'interligne dans les textes courants. */
main p, main li, main td { line-height: 1.55; }

/* Les personnes qui préfèrent moins d'animation sont respectées partout. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Hiérarchie des actions (2026-09-30) ───────────────────────────────────
   Constat sur l'écran Employés : « PDF » rouge vif, « Excel » vert vif et
   « Ajouter » vert vif côte à côte. Trois couleurs pleines se disputent
   l'attention alors qu'UNE SEULE action crée quelque chose — les deux autres
   sont des exports, utiles mais secondaires.
   Règle : une seule action colorée par écran ; les actions d'appoint prennent
   le style doux ci-dessous. Classes réutilisables, pour que les écrans repris
   ensuite soient cohérents entre eux sans réinventer un style à chaque fois. */
.arc-btn-doux {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563;
  background: #fff;
  border: 1px solid rgb(17 24 39 / 0.1);
  transition: background-color .15s, border-color .15s, color .15s;
}
.arc-btn-doux:hover { background: #f9fafb; border-color: rgb(17 24 39 / 0.18); color: #111827; }
/* L'icône garde un rappel de couleur : on reconnaît PDF/Excel au premier coup d'œil,
   sans que le bouton entier crie. */
.arc-btn-doux .fa-file-pdf   { color: #dc2626; }
.arc-btn-doux .fa-file-excel { color: #16a34a; }

/* ── Actions répétées dans les lignes d'un tableau (2026-09-30) ────────────
   Mesuré sur les écrans réels : « Demandes moto — suivi » affichait 25 boutons
   en COULEUR PLEINE, un par ligne, empilés verticalement. Une couleur qui se
   répète 25 fois n'attire plus l'œil : elle le fatigue, et elle vole la
   vedette aux vraies alertes de la page (retards, urgences).
   Une action de ligne prend donc ce style discret ; la couleur reste réservée
   à l'ÉTAT (en retard, urgent) et à l'action principale, unique, en haut. */
.arc-action-ligne {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #15803d;                       /* vert de la marque, en texte */
  background: rgb(22 163 74 / 0.08);
  border: 1px solid rgb(22 163 74 / 0.18);
  transition: background-color .15s, border-color .15s;
  white-space: nowrap;
}
.arc-action-ligne:hover { background: rgb(22 163 74 / 0.16); border-color: rgb(22 163 74 / 0.32); }
