/*
 * FlowYa Cockpit — thème premium (Filament v3)
 * ---------------------------------------------------------------------------
 * Fichier CSS unique pour le cockpit : garder les overrides visuels ici
 * (pas de styles dispersés dans les vues). Chargé après le thème Filament
 * (hook panels::styles.after dans AdminPanelProvider) pour ne pas être écrasé.
 *
 * Sélecteurs : le <body> a la classe fi-panel-{id} (ex. fi-panel-admin ou
 * fi-panel-cockpit). On cible les deux pour que le thème s’applique même si
 * l’id du panel change entre environnements.
 * ---------------------------------------------------------------------------
 */
:root {
  /* —— Marque FlowYa —— */
  --fy-orange: #f47b4a;
  --fy-orange-deep: #ea580c;
  --fy-orange-soft: rgba(244, 123, 74, 0.14);
  --fy-orange-glow: rgba(244, 123, 74, 0.22);
  /* Vert thérapeutique / qualitatif (accents, pas saturation) */
  --fy-green: #0f766e;
  --fy-green-soft: rgba(15, 118, 110, 0.11);
  --fy-green-muted: #115e59;
  --fy-teal-glow: rgba(15, 118, 110, 0.12);
  /* Texte & surfaces */
  --fy-ink: #0f172a;
  --fy-muted: #64748b;
  --fy-muted-soft: #94a3b8;
  --fy-surface: #ffffff;
  --fy-surface-2: #fbf6f2;
  --fy-surface-3: #f3ebe4;
  --fy-surface-warm: #fffbf7;
  --fy-border: rgba(15, 23, 42, 0.1);
  --fy-border-warm: rgba(244, 123, 74, 0.14);
  /* Ombres */
  --fy-shadow-warm: 0 8px 28px -6px rgba(244, 123, 74, 0.18);
  --fy-shadow-soft: 0 2px 8px rgba(15, 23, 42, 0.05);
  --fy-ring-inset: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  --fy-ring-inset-strong: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  /* Relief premium (cartes, panneaux) */
  --fy-elev-1: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 16px -4px rgba(244, 123, 74, 0.1);
  --fy-elev-2: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 14px 32px -10px rgba(244, 123, 74, 0.18),
    var(--fy-ring-inset);
  --fy-elev-kpi: 0 2px 4px rgba(15, 23, 42, 0.04), 0 10px 28px -6px rgba(15, 23, 42, 0.07),
    0 12px 36px -10px rgba(244, 123, 74, 0.14), var(--fy-ring-inset-strong);
  --fy-elev-hover: 0 10px 22px -6px rgba(15, 23, 42, 0.1), 0 22px 48px -12px rgba(244, 123, 74, 0.26),
    var(--fy-ring-inset);
  --fy-radius-card: 1.125rem;
  --fy-radius-lg: 1.35rem;
  --fy-radius-pill: 999px;
  /* Transitions */
  --fy-ease-out: cubic-bezier(0.34, 1.15, 0.64, 1);
  --fy-duration: 0.22s;
}

/* ——— Fond général (remplace le gris Filament par une base chaude) ——— */
:is(.fi-body.fi-panel-admin, .fi-body.fi-panel-cockpit) {
  background: linear-gradient(
    168deg,
    var(--fy-surface-2) 0%,
    #f5efe8 32%,
    #faf7f4 58%,
    #fffcfa 100%
  ) !important;
  background-attachment: fixed;
}

.dark :is(.fi-body.fi-panel-admin, .fi-body.fi-panel-cockpit) {
  background: linear-gradient(168deg, #0c0a09 0%, #1a1816 45%, #0f172a 100%) !important;
}

/* Colonne principale — espace sous la topbar (homogène toutes pages Cockpit) */
.fi-main {
  padding-top: 0.5rem;
  padding-bottom: 2.75rem;
}

/* ——— Sidebar ——— */
.fi-sidebar {
  background: radial-gradient(1200px 600px at -10% -20%, rgba(244, 123, 74, 0.2), transparent 58%),
    radial-gradient(900px 480px at 120% 10%, var(--fy-teal-glow), transparent 55%),
    linear-gradient(180deg, #fffef9 0%, #ffffff 100%);
  border-right: 1px solid var(--fy-border);
  box-shadow: 4px 0 24px -12px rgba(15, 23, 42, 0.08);
}

.dark .fi-sidebar {
  background: radial-gradient(900px 500px at -5% 0%, rgba(244, 123, 74, 0.12), transparent 50%),
    linear-gradient(180deg, #1c1917 0%, #0f0f0f 100%);
  box-shadow: 4px 0 32px -8px rgba(0, 0, 0, 0.35);
}

.fi-sidebar-header {
  border-bottom: 1px solid var(--fy-border);
  padding-top: 0.8rem !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-sidebar-header.fy-sidebar-brand-header {
  background: linear-gradient(100deg, #fffdfb 0%, #ffffff 55%, #fbf6f2 100%) !important;
  box-shadow: 0 6px 20px -10px rgba(244, 123, 74, 0.15) !important;
  border-bottom: 1px solid rgba(244, 123, 74, 0.1) !important;
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-sidebar-header.fy-sidebar-brand-header {
  background: linear-gradient(100deg, rgb(28 27 26) 0%, rgb(23 23 23) 100%) !important;
  border-bottom-color: rgba(244, 123, 74, 0.18) !important;
}

/* Wordmark FlowYa : largeur auto + léger relief (hauteur inline = brandLogoHeight). */
:is(body.fi-panel-admin, body.fi-panel-cockpit) img.fy-flowya-brand-logo-img {
  width: auto !important;
  max-width: min(12.5rem, 100%) !important;
  object-fit: contain !important;
  object-position: left center;
  filter: drop-shadow(0 2px 4px rgba(244, 123, 74, 0.16)) drop-shadow(0 1px 0 rgba(255, 255, 255, 0.9));
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) img.fy-flowya-brand-logo-img {
  filter: drop-shadow(0 2px 6px rgba(244, 123, 74, 0.25));
}

/* Cloche notifications (activée via ->databaseNotifications() sur le panel). */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar .fi-topbar-database-notifications-btn {
  position: relative;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar .fi-topbar-database-notifications-btn:hover {
  color: var(--fy-orange) !important;
  background-color: rgba(244, 123, 74, 0.1) !important;
}

.fi-sidebar-nav .fi-sidebar-item a,
.fi-sidebar-nav .fi-sidebar-item button {
  border-radius: 12px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.fi-sidebar-nav .fi-sidebar-item a:hover,
.fi-sidebar-nav .fi-sidebar-item button:hover {
  background: var(--fy-orange-soft);
  box-shadow: var(--fy-shadow-soft);
}

.fi-sidebar-nav .fi-sidebar-item.fi-active a {
  background: linear-gradient(90deg, rgba(244, 123, 74, 0.22) 0%, rgba(244, 123, 74, 0.08) 100%);
  box-shadow: inset 3px 0 0 var(--fy-orange), var(--fy-shadow-soft);
  font-weight: 600;
}

/* Groupes de navigation */
.fi-sidebar-group-button {
  border-radius: 10px;
}

/*
 * Topbar : fond sur le <nav> (Tailwind bg-white). Mode sidebar = barre quasi vide sans marque :
 * on injecte « FlowYa · Cockpit » côté Blade + styles ici.
 */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar {
  border-bottom: none !important;
  background: transparent !important;
  padding-top: 0.5rem;
  padding-bottom: 0.35rem;
  padding-inline: 0.7rem;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar > nav.fy-premium-topbar-nav,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar > nav {
  position: relative !important;
  isolation: isolate;
  min-height: 5rem !important;
  border-radius: 1.25rem !important;
  background: linear-gradient(
    100deg,
    #fffdfb 0%,
    #ffffff 28%,
    rgba(244, 123, 74, 0.07) 52%,
    #fffefb 78%,
    #f8f2ec 100%
  ) !important;
  background-color: rgba(255, 254, 251, 0.92) !important;
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  backdrop-filter: blur(10px) saturate(1.15);
  box-shadow: 0 14px 44px -18px rgba(244, 123, 74, 0.45), 0 8px 20px -10px rgba(15, 23, 42, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(244, 123, 74, 0.20) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.88) !important;
  margin-bottom: 0.55rem;
  margin-inline: 0.35rem;
  overflow: visible !important; /* notifications: avoid clipping slide-over */
  --tw-ring-shadow: 0 0 #0000 !important;
  --tw-shadow: 0 0 #0000 !important;
  --tw-shadow-colored: 0 0 #0000 !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-topbar-context {
  margin-left: 0.25rem;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-topbar-context-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(244, 123, 74, 0.25);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 249, 245, 0.9));
  box-shadow: 0 2px 8px rgba(244, 123, 74, 0.12);
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-topbar-context-icon {
  font-size: 0.8rem;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-topbar-context-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #9a3412;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-topbar-context-meta {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
}

/* ——— Standard topbar page cockpit : titre gauche, contexte droite (avant ms-auto : recherche / cloche / avatar) ——— */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-cockpit-topbar-page {
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-cockpit-topbar-page-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: rgb(15 23 42);
}

@media (min-width: 1280px) {
  :is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-cockpit-topbar-page-title {
    font-size: 1.35rem;
  }
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-cockpit-topbar-page-context {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  color: rgb(100 116 139);
  letter-spacing: 0.01em;
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-cockpit-topbar-page-title {
  color: #fff;
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-cockpit-topbar-page-context {
  color: rgb(148 163 184);
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar > nav.fy-premium-topbar-nav::before,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar > nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(900px 140px at 10% 0%, rgba(244, 123, 74, 0.18), transparent 58%),
    radial-gradient(700px 120px at 90% 100%, rgba(13, 148, 136, 0.10), transparent 55%);
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar > nav.fy-premium-topbar-nav > *,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar > nav > * {
  position: relative;
  z-index: 1;
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar > nav.fy-premium-topbar-nav,
.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar > nav {
  background: linear-gradient(100deg, rgb(30 28 26) 0%, rgb(23 23 23) 40%, rgb(26 32 30) 100%) !important;
  background-color: rgba(23, 23, 23, 0.92) !important;
  border-bottom-color: rgba(244, 123, 74, 0.28) !important;
  border-left-color: rgb(251 146 60) !important;
  box-shadow: 0 18px 46px -16px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

/* Agenda filters: always clickable and visibly toggled */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-calendar-shell .fy-filter-chip {
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative;
  padding-right: 4.1rem !important;
  border-width: 1.5px !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-calendar-shell .fy-filter-chip.is-off {
  opacity: .38 !important;
  filter: saturate(.55);
  transform: none !important;
  box-shadow: none !important;
  border-style: dashed !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-calendar-shell .fy-filter-chip::after {
  content: "ACTIF";
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.34rem;
  border-radius: 999px;
  color: #065f46;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(5, 150, 105, 0.28);
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-calendar-shell .fy-filter-chip.is-off::after {
  content: "MASQUÉ";
  color: #9a3412;
  background: rgba(251, 146, 60, 0.16);
  border-color: rgba(234, 88, 12, 0.28);
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar > nav::before {
  background: radial-gradient(800px 120px at 15% 0%, rgba(244, 123, 74, 0.15), transparent 50%);
}

/* Notifications panel (right slide-over): premium FlowYa readability */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-modal-window {
  background: linear-gradient(180deg, #fffefb 0%, #fff 38%, #f8f2ec 100%) !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-modal-header {
  background: linear-gradient(110deg, rgba(244, 123, 74, 0.13), rgba(13, 148, 136, 0.09) 55%, rgba(255, 255, 255, 0.9)) !important;
  border-bottom: 1px solid rgba(244, 123, 74, 0.2) !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-modal-heading {
  font-weight: 800 !important;
  letter-spacing: -0.01em;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-no-notification.fi-inline {
  border: 1px solid rgba(244, 123, 74, 0.18) !important;
  border-radius: 0.95rem !important;
  margin: 0.42rem 0.65rem !important;
  background: linear-gradient(160deg, #ffffff 0%, #fffdfb 68%, #f9f3ed 100%) !important;
  box-shadow: 0 6px 18px -12px rgba(15, 23, 42, 0.32) !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-no-notification-title {
  color: #0f172a !important;
  font-weight: 800 !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-no-notification-date {
  color: #6b7280 !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-no-notification-body {
  color: #475569 !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-no-notification-actions .fi-link {
  color: #c2410c !important;
  font-weight: 700 !important;
}

/* Pastille marque (vue topbar) */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-topbar-cockpit-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff !important;
  background: linear-gradient(135deg, var(--fy-orange) 0%, #ea580c 48%, #0f766e 130%);
  box-shadow: 0 2px 10px rgba(244, 123, 74, 0.45), 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}

/* Champ recherche globale */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar .fi-global-search-field .fi-input-wrp {
  border-radius: 0.75rem !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar .fi-global-search-field .fi-input-wrp,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar .fi-global-search-field input {
  border-color: rgba(244, 123, 74, 0.2) !important;
  box-shadow: 0 1px 4px rgba(244, 123, 74, 0.08) !important;
  transition: border-color 0.15s ease, box-shadow 0.2s ease !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar .fi-global-search-field input:focus {
  border-color: rgba(244, 123, 74, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(244, 123, 74, 0.15) !important;
}

/* Icônes topbar : survol chaud */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar .fi-icon-btn,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar .fi-topbar-database-notifications-btn {
  border-radius: 0.75rem !important;
  transition: background-color 0.15s ease, box-shadow 0.2s ease, transform 0.15s ease !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar .fi-icon-btn:hover,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar .fi-topbar-database-notifications-btn:hover {
  background-color: rgba(244, 123, 74, 0.1) !important;
  box-shadow: 0 2px 8px rgba(244, 123, 74, 0.12) !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar .fi-avatar,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar img.fi-avatar {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 0 0 3px rgba(244, 123, 74, 0.45) !important;
}

/* Bandeau dégradé sous la topbar */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar::after {
  content: "";
  display: block;
  height: 3px;
  width: calc(100% - 1.25rem);
  margin: 0 auto;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--fy-orange) 0%, #f97316 35%, #14b8a6 100%);
  opacity: 1;
  pointer-events: none;
  box-shadow: 0 2px 12px rgba(244, 123, 74, 0.35);
}

/*
 * En-tête de page (titre + fil d’Ariane) : ciblage DOM Filament, sans dépendre de la classe
 * fy-premium-page-header (vue publiée parfois absente / pas déployée sur tous les serveurs).
 */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header,
header.fi-header.fy-premium-page-header {
  position: relative;
  isolation: isolate;
  margin: 0 0 0.25rem !important;
  padding: 0.95rem 1.65rem 1.25rem !important;
  border-radius: var(--fy-radius-lg) !important;
  border: 1px solid rgba(244, 123, 74, 0.2) !important;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.99) 0%,
    #fffefb 32%,
    rgba(244, 123, 74, 0.06) 55%,
    #fbf6f2 100%
  ) !important;
  box-shadow: var(--fy-elev-2), 0 0 0 1px rgba(255, 255, 255, 0.6) inset !important;
  overflow: hidden;
  transition: box-shadow 0.25s ease, border-color 0.2s ease;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header:hover,
header.fi-header.fy-premium-page-header:hover {
  box-shadow: var(--fy-elev-hover) !important;
  border-color: rgba(244, 123, 74, 0.28) !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header::before,
header.fi-header.fy-premium-page-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  z-index: 1;
  border-radius: var(--fy-radius-lg) var(--fy-radius-lg) 0 0;
  background: linear-gradient(90deg, var(--fy-orange) 0%, #fb923c 38%, #2dd4bf 100%);
  pointer-events: none;
  box-shadow: 0 2px 12px rgba(244, 123, 74, 0.25);
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header::after,
header.fi-header.fy-premium-page-header::after {
  content: "";
  position: absolute;
  top: -35%;
  right: -6%;
  width: min(320px, 55vw);
  height: 220px;
  z-index: 0;
  background: radial-gradient(ellipse at center, rgba(244, 123, 74, 0.11), transparent 68%);
  pointer-events: none;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header > div,
header.fi-header.fy-premium-page-header > div {
  position: relative;
  z-index: 2;
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header,
.dark header.fi-header.fy-premium-page-header {
  border-color: rgba(244, 123, 74, 0.22) !important;
  background: linear-gradient(128deg, rgba(38, 36, 34, 0.98) 0%, rgb(28 27 26) 55%, rgb(23 23 23) 100%) !important;
  box-shadow: 0 8px 28px -8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header::after,
.dark header.fi-header.fy-premium-page-header::after {
  background: radial-gradient(ellipse at center, rgba(244, 123, 74, 0.14), transparent 65%);
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header .fi-breadcrumbs,
header.fi-header.fy-premium-page-header .fi-breadcrumbs {
  opacity: 0.92;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header .fi-breadcrumbs-item-label,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header .fi-breadcrumbs-item-separator,
header.fi-header.fy-premium-page-header .fi-breadcrumbs-item-label,
header.fi-header.fy-premium-page-header .fi-breadcrumbs-item-separator {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header .fi-breadcrumbs-item-label,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header .fi-breadcrumbs-item a,
header.fi-header.fy-premium-page-header .fi-breadcrumbs-item-label,
header.fi-header.fy-premium-page-header .fi-breadcrumbs-item a {
  color: rgb(100 116 139);
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header .fi-breadcrumbs-item:last-child .fi-breadcrumbs-item-label,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header .fi-breadcrumbs-item:last-child a,
header.fi-header.fy-premium-page-header .fi-breadcrumbs-item:last-child .fi-breadcrumbs-item-label,
header.fi-header.fy-premium-page-header .fi-breadcrumbs-item:last-child a {
  color: var(--fy-orange);
  font-weight: 600;
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header .fi-breadcrumbs-item-label,
.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header .fi-breadcrumbs-item a,
.dark header.fi-header.fy-premium-page-header .fi-breadcrumbs-item-label,
.dark header.fi-header.fy-premium-page-header .fi-breadcrumbs-item a {
  color: rgb(148 163 184);
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header .fi-breadcrumbs-item:last-child .fi-breadcrumbs-item-label,
.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header .fi-breadcrumbs-item:last-child a,
.dark header.fi-header.fy-premium-page-header .fi-breadcrumbs-item:last-child .fi-breadcrumbs-item-label,
.dark header.fi-header.fy-premium-page-header .fi-breadcrumbs-item:last-child a {
  color: rgb(251 146 60);
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header .fi-header-heading,
header.fi-header.fy-premium-page-header .fi-header-heading {
  letter-spacing: -0.03em;
  font-weight: 800 !important;
  line-height: 1.15;
  color: rgb(15 23 42) !important;
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header .fi-header-heading,
.dark header.fi-header.fy-premium-page-header .fi-header-heading {
  color: #fff !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header .fi-header-subheading,
header.fi-header.fy-premium-page-header .fi-header-subheading {
  color: rgb(71 85 105);
  max-width: 52rem;
  line-height: 1.55;
  font-size: 1.0625rem;
}

/* Rapproche le sous-titre du titre (modèle type Pilotage agenda) */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header .fi-header-heading + .fi-header-subheading,
header.fi-header.fy-premium-page-header .fi-header-heading + .fi-header-subheading {
  margin-top: 0.35rem !important;
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-page header.fi-header .fi-header-subheading,
.dark header.fi-header.fy-premium-page-header .fi-header-subheading {
  color: rgb(148 163 184);
}

/* ——— En-tête « simple » (login, etc.) ——— */
.fi-simple-header.fy-premium-simple-header {
  position: relative;
  width: 100%;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
  padding: 2rem 1.75rem 1.75rem;
  border-radius: 1rem;
  border: 1px solid rgba(244, 123, 74, 0.14);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.98) 0%, var(--fy-surface-2) 100%);
  box-shadow: var(--fy-shadow-soft), var(--fy-shadow-warm), var(--fy-ring-inset);
  overflow: hidden;
}

.fi-simple-header.fy-premium-simple-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 1rem 1rem 0 0;
  background: linear-gradient(90deg, var(--fy-orange), rgba(15, 118, 110, 0.55));
  pointer-events: none;
}

.dark .fi-simple-header.fy-premium-simple-header {
  border-color: rgba(244, 123, 74, 0.2);
  background: linear-gradient(165deg, rgb(38 36 34) 0%, rgb(23 23 23) 100%);
}

/* ——— Sections / cartes (contenu principal) ——— */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-section {
  border: 1px solid rgba(244, 123, 74, 0.14) !important;
  border-radius: var(--fy-radius-lg) !important;
  box-shadow: var(--fy-elev-2) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, #ffffff 55%) !important;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-section:hover {
  box-shadow: var(--fy-elev-hover) !important;
  border-color: rgba(244, 123, 74, 0.22) !important;
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-section {
  border-color: rgba(244, 123, 74, 0.18) !important;
  background: linear-gradient(180deg, rgba(38, 36, 34, 0.98) 0%, rgb(23 23 23) 100%) !important;
  box-shadow: 0 8px 32px -10px rgba(0, 0, 0, 0.45) !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-section-header {
  background: linear-gradient(90deg, rgba(244, 123, 74, 0.07) 0%, transparent 60%) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-section-header {
  border-bottom-color: rgba(255, 255, 255, 0.06) !important;
  background: linear-gradient(90deg, rgba(244, 123, 74, 0.1) 0%, transparent 55%) !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-section-content {
  background: rgba(255, 255, 255, 0.35);
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-section-content {
  background: transparent;
}

/* Cartes Filament génériques — relief SaaS */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-card {
  border: 1px solid rgba(244, 123, 74, 0.12) !important;
  border-radius: var(--fy-radius-card) !important;
  box-shadow: var(--fy-elev-1), 0 0 0 1px rgba(255, 255, 255, 0.5) inset !important;
  background: linear-gradient(165deg, #ffffff 0%, #fffdfb 100%) !important;
  transition: transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1), box-shadow 0.25s ease, border-color 0.2s ease !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(244, 123, 74, 0.22) !important;
  box-shadow: var(--fy-elev-hover) !important;
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-card {
  background: linear-gradient(165deg, rgb(38 36 34) 0%, rgb(26 25 24) 100%) !important;
  border-color: rgba(244, 123, 74, 0.18) !important;
}

/* ——— Tableaux ——— */
.fi-ta-ctn,
.fi-ta-content {
  border-radius: 0.75rem;
}

.fi-ta-ctn {
  border-radius: var(--fy-radius-card) !important;
  box-shadow: var(--fy-elev-1), 0 0 0 1px rgba(244, 123, 74, 0.06) !important;
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-ta-ctn:hover {
  box-shadow: var(--fy-elev-2) !important;
}

/* Lignes de tableau : survol tactile */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-ta-table tbody tr {
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-ta-table tbody tr:hover td {
  background-color: rgba(244, 123, 74, 0.06) !important;
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-ta-table tbody tr:hover td {
  background-color: rgba(244, 123, 74, 0.12) !important;
}

/*
 * Pilotage prod « Cadre général » : grille avec divs border + bg (souvent sans rounded-xl).
 * Exclut les blocs formulaire / infolist Filament évidents.
 */
:is(body.fi-panel-admin, body.fi-panel-cockpit)
  .fi-section-content
  div[class*="grid"][class*="gap-"]
  > div[class*="border-gray"]:not([class*="fi-fo-"]):not(.fi-in-entry-wrp):not(.fi-fo-component-ctn),
:is(body.fi-panel-admin, body.fi-panel-cockpit)
  .fi-section-content
  div[class*="grid"][class*="gap-"]
  > div[class*="border-slate"]:not([class*="fi-fo-"]):not(.fi-in-entry-wrp),
:is(body.fi-panel-admin, body.fi-panel-cockpit)
  .fi-section-content
  div[class*="grid"][class*="gap-"]
  > div.ring-1:not([class*="fi-fo-"]):not(.fi-in-entry-wrp),
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-main .fy-pilotage-metric-cell,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-section-content div.grid > div.rounded-xl,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-section-content div.grid > div.rounded-lg,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-resource-edit-record-page .fi-section-content div.grid > div.rounded-xl,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-resource-edit-record-page .fi-section-content div.grid > div.rounded-lg,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-resource-view-record-page .fi-section-content div.grid > div.rounded-xl,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-resource-view-record-page .fi-section-content div.grid > div.rounded-lg,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-pilotage-hub div.grid > div.rounded-xl,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-pilotage-hub div.grid > div.rounded-lg,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-main .fy-saas-tile {
  border-radius: var(--fy-radius-card) !important;
  border: 1px solid rgba(244, 123, 74, 0.11) !important;
  background: linear-gradient(158deg, #ffffff 0%, #fffdfb 42%, #f8f2ec 100%) !important;
  box-shadow: var(--fy-elev-1), var(--fy-ring-inset) !important;
  transition: transform 0.22s cubic-bezier(0.34, 1.15, 0.64, 1), box-shadow 0.28s ease,
    border-color 0.2s ease !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit)
  .fi-section-content
  div[class*="grid"][class*="gap-"]
  > div[class*="border-gray"]:not([class*="fi-fo-"]):not(.fi-in-entry-wrp):not(.fi-fo-component-ctn):hover,
:is(body.fi-panel-admin, body.fi-panel-cockpit)
  .fi-section-content
  div[class*="grid"][class*="gap-"]
  > div[class*="border-slate"]:not([class*="fi-fo-"]):not(.fi-in-entry-wrp):hover,
:is(body.fi-panel-admin, body.fi-panel-cockpit)
  .fi-section-content
  div[class*="grid"][class*="gap-"]
  > div.ring-1:not([class*="fi-fo-"]):not(.fi-in-entry-wrp):hover,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-main .fy-pilotage-metric-cell:hover,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-section-content div.grid > div.rounded-xl:hover,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-section-content div.grid > div.rounded-lg:hover,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-resource-edit-record-page .fi-section-content div.grid > div.rounded-xl:hover,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-resource-edit-record-page .fi-section-content div.grid > div.rounded-lg:hover,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-resource-view-record-page .fi-section-content div.grid > div.rounded-xl:hover,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-resource-view-record-page .fi-section-content div.grid > div.rounded-lg:hover,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-pilotage-hub div.grid > div.rounded-xl:hover,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-pilotage-hub div.grid > div.rounded-lg:hover,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-main .fy-saas-tile:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(244, 123, 74, 0.28) !important;
  box-shadow: var(--fy-elev-hover) !important;
}

.dark
  :is(body.fi-panel-admin, body.fi-panel-cockpit)
  .fi-section-content
  div[class*="grid"][class*="gap-"]
  > div[class*="border-gray"]:not([class*="fi-fo-"]):not(.fi-in-entry-wrp):not(.fi-fo-component-ctn),
.dark
  :is(body.fi-panel-admin, body.fi-panel-cockpit)
  .fi-section-content
  div[class*="grid"][class*="gap-"]
  > div[class*="border-slate"]:not([class*="fi-fo-"]):not(.fi-in-entry-wrp),
.dark
  :is(body.fi-panel-admin, body.fi-panel-cockpit)
  .fi-section-content
  div[class*="grid"][class*="gap-"]
  > div.ring-1:not([class*="fi-fo-"]):not(.fi-in-entry-wrp),
.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-main .fy-pilotage-metric-cell,
.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-section-content div.grid > div.rounded-xl,
.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-section-content div.grid > div.rounded-lg,
.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-resource-edit-record-page .fi-section-content div.grid > div.rounded-xl,
.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-resource-edit-record-page .fi-section-content div.grid > div.rounded-lg,
.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-resource-view-record-page .fi-section-content div.grid > div.rounded-xl,
.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-resource-view-record-page .fi-section-content div.grid > div.rounded-lg,
.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-pilotage-hub div.grid > div.rounded-xl,
.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-pilotage-hub div.grid > div.rounded-lg,
.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-main .fy-saas-tile {
  background: linear-gradient(158deg, rgb(40 38 36) 0%, rgb(28 27 26) 100%) !important;
  border-color: rgba(244, 123, 74, 0.16) !important;
}

/* Boutons outline / secondaires : moins plats */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-btn {
  border-radius: 0.75rem !important;
  transition: transform 0.18s cubic-bezier(0.34, 1.2, 0.64, 1), box-shadow 0.22s ease, background-color 0.15s ease !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-btn:hover {
  transform: translateY(-1px);
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-btn:active {
  transform: translateY(0);
}

/* ——— Bouton primaire ——— */
.fi-btn-color-primary {
  box-shadow: 0 2px 10px -2px rgba(244, 123, 74, 0.45), 0 1px 2px rgba(15, 23, 42, 0.06);
}

.fi-btn-color-primary:hover {
  box-shadow: 0 6px 20px -4px rgba(244, 123, 74, 0.55), 0 2px 6px rgba(15, 23, 42, 0.08);
}

/* ——— Grille Pilotage agenda (hub) ——— */
.fy-pilotage-hub .fi-btn {
  border-radius: 0.75rem !important;
  justify-content: flex-start;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fy-pilotage-hub .fi-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(244, 123, 74, 0.2);
}

/* ——— Cartes stats explicites (.fy-stat-card en Blade) ——— */
.fy-stat-card {
  border-radius: var(--fy-radius-card);
  border: 1px solid rgba(244, 123, 74, 0.12);
  background: linear-gradient(152deg, #ffffff 0%, var(--fy-surface-2) 100%);
  box-shadow: var(--fy-elev-1), var(--fy-ring-inset);
  transition: transform 0.22s cubic-bezier(0.34, 1.15, 0.64, 1), box-shadow 0.25s ease, border-color 0.2s ease;
}

.fy-stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(244, 123, 74, 0.28);
  box-shadow: var(--fy-elev-hover);
}

.dark .fy-stat-card {
  border-color: rgba(255, 255, 255, 0.08);
  background: linear-gradient(148deg, rgba(40, 38, 36, 0.95) 0%, rgb(23 23 23) 100%);
}

/* ——— Page Agenda (calendrier FullCalendar) ——— */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-agenda-pilotage-banner {
  border-radius: var(--fy-radius-card) !important;
  border: 1px solid rgba(244, 123, 74, 0.22) !important;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 123, 74, 0.09) 45%, #fffefb 100%) !important;
  box-shadow: var(--fy-elev-1), var(--fy-ring-inset) !important;
  transition: box-shadow 0.22s ease, transform 0.2s ease;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-agenda-pilotage-banner:hover {
  box-shadow: var(--fy-elev-2) !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-calendar-shell {
  border-radius: var(--fy-radius-lg) !important;
  border: 1px solid rgba(244, 123, 74, 0.14) !important;
  background: linear-gradient(165deg, #ffffff 0%, #fffdfb 100%) !important;
  box-shadow: var(--fy-elev-2) !important;
  padding: 1rem !important;
  transition: box-shadow 0.25s ease, border-color 0.2s ease;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-calendar-shell:hover {
  box-shadow: var(--fy-elev-hover) !important;
  border-color: rgba(244, 123, 74, 0.22) !important;
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-calendar-shell {
  background: linear-gradient(165deg, rgb(38 36 34) 0%, rgb(23 23 23) 100%) !important;
}

/* Barre d’outils FullCalendar : boutons FlowYa */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-calendar-shell .fc .fc-button {
  border-radius: 0.65rem !important;
  font-weight: 600 !important;
  text-transform: none !important;
  transition: background-color 0.15s ease, box-shadow 0.2s ease, transform 0.12s ease !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-calendar-shell .fc .fc-button-primary:not(:disabled):not(.fc-button-active) {
  background: rgba(244, 123, 74, 0.12) !important;
  border-color: rgba(244, 123, 74, 0.25) !important;
  color: rgb(154 52 18) !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-calendar-shell .fc .fc-button-primary.fc-button-active,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-calendar-shell .fc .fc-button-primary:not(:disabled):active {
  background: linear-gradient(135deg, var(--fy-orange), #ea580c) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(244, 123, 74, 0.4) !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-calendar-shell .fc .fc-button-primary:not(:disabled):hover {
  transform: translateY(-1px);
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-calendar-shell .fc .fc-toolbar-title {
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  color: rgb(15 23 42) !important;
}

.dark :is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-calendar-shell .fc .fc-toolbar-title {
  color: #fff !important;
}

/* Chips légende agenda (.fy-chip dans la vue) */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-calendar-shell .fy-chip {
  border-radius: 999px !important;
  transition: transform 0.12s ease, box-shadow 0.15s ease !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-calendar-shell .fy-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* ——— Empty states ——— */
.fi-empty-state {
  background: linear-gradient(180deg, var(--fy-surface-2), #fff);
  border: 1px dashed rgba(244, 123, 74, 0.35);
  border-radius: 1rem;
}

/* Legacy pilotage cards fallback:
 * Matches the exact HTML classes currently rendered on prod screenshot.
 */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-main .rounded-2xl.border.border-slate-200.bg-white {
  border-radius: 1.125rem !important;
  border-color: rgba(244, 123, 74, 0.24) !important;
  background: linear-gradient(155deg, #ffffff 0%, #fffbf7 38%, #efe4db 100%) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.92) inset,
    0 16px 44px -14px rgba(244, 123, 74, 0.30),
    0 10px 28px -12px rgba(15, 23, 42, 0.12) !important;
  transition: transform 0.22s cubic-bezier(0.34, 1.15, 0.64, 1), box-shadow 0.28s ease,
    border-color 0.2s ease !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-main .rounded-2xl.border.border-slate-200.bg-white:hover {
  transform: translateY(-3px) !important;
  border-color: rgba(244, 123, 74, 0.36) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 24px 56px -16px rgba(244, 123, 74, 0.34),
    0 12px 32px -10px rgba(15, 23, 42, 0.14) !important;
}

/* =============================================================================
 * Design system FlowYa — classes réutilisables cockpit
 * (combinables avec Filament / Tailwind ; ne remplacent pas le markup métier)
 * ============================================================================= */

.fy-surface {
  background: linear-gradient(168deg, var(--fy-surface-warm) 0%, #ffffff 55%);
  border: 1px solid var(--fy-border-warm);
  border-radius: var(--fy-radius-card);
  box-shadow: var(--fy-elev-1);
}

.fy-panel {
  border-radius: var(--fy-radius-lg);
  border: 1px solid var(--fy-border-warm);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, #ffffff 100%);
  box-shadow: var(--fy-elev-2);
}

.fy-card-premium,
.fy-kpi-card {
  border-radius: var(--fy-radius-card) !important;
  border: 1px solid var(--fy-border-warm) !important;
  background: linear-gradient(165deg, #ffffff 0%, var(--fy-surface-warm) 42%, #f4ebe3 100%) !important;
  box-shadow: var(--fy-elev-kpi) !important;
  transition: transform var(--fy-duration) var(--fy-ease-out), box-shadow 0.28s ease, border-color 0.2s ease !important;
}

.fy-card-premium:hover,
.fy-kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(244, 123, 74, 0.32) !important;
  box-shadow: var(--fy-elev-hover) !important;
}

.dark .fy-card-premium,
.dark .fy-kpi-card {
  background: linear-gradient(165deg, rgb(40 38 36) 0%, rgb(28 27 26) 100%) !important;
  border-color: rgba(244, 123, 74, 0.2) !important;
}

.fy-section-title {
  font-weight: 800 !important;
  letter-spacing: -0.025em !important;
  line-height: 1.2 !important;
  color: var(--fy-ink) !important;
}

.dark .fy-section-title {
  color: #fff !important;
}

.fy-muted {
  color: var(--fy-muted) !important;
}

.fy-muted-soft {
  color: var(--fy-muted-soft) !important;
}

.fy-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: var(--fy-radius-pill);
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--fy-orange-soft);
  color: rgb(154 52 18);
  border: 1px solid rgba(244, 123, 74, 0.22);
  box-shadow: 0 1px 2px rgba(244, 123, 74, 0.08);
}

.dark .fy-chip {
  color: rgb(253 186 116);
  background: rgba(244, 123, 74, 0.15);
  border-color: rgba(244, 123, 74, 0.28);
}

.fy-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 0.5rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--fy-green-soft);
  color: var(--fy-green-muted);
  border: 1px solid rgba(15, 118, 110, 0.2);
}

.fy-btn-soft {
  border-radius: 0.75rem !important;
  border: 1px solid rgba(244, 123, 74, 0.2) !important;
  background: linear-gradient(180deg, #ffffff, var(--fy-surface-2)) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
  transition: transform 0.18s var(--fy-ease-out), box-shadow 0.2s ease, border-color 0.15s ease !important;
}

.fy-btn-soft:hover {
  transform: translateY(-1px);
  border-color: rgba(244, 123, 74, 0.35) !important;
  box-shadow: 0 6px 16px -4px rgba(244, 123, 74, 0.18) !important;
}

/* Badges Filament : lisibilité + chaleur */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-badge {
  border-radius: 0.5rem !important;
  font-weight: 600 !important;
}

/* Champs formulaire : bordures chaudes, focus orange (sans casser l’accessibilité) */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-input-wrp,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-fo-field-wrp .fi-input-wrp {
  border-radius: 0.75rem !important;
  transition: border-color 0.15s ease, box-shadow 0.2s ease !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-input-wrp:focus-within {
  border-color: rgba(244, 123, 74, 0.35) !important;
  box-shadow: 0 0 0 3px rgba(244, 123, 74, 0.12) !important;
}

/* Filtres / barres d’outils table */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-ta-header-toolbar {
  border-radius: var(--fy-radius-card) !important;
  border: 1px solid rgba(244, 123, 74, 0.1) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), var(--fy-surface-2)) !important;
  box-shadow: var(--fy-elev-1) !important;
}

/* =============================================================================
 * Pilotage agenda & hubs — spécificité renforcée (body.fi-body + hub)
 * Garantit le relief même si utilitaires Tailwind chargés après.
 * ============================================================================= */

/* Fallback : ne dépend pas du wrapper .fy-pilotage-hub
 * (si la structure/IDs diffèrent encore entre environnements, les cartes
 * doivent quand même retrouver un relief premium).
 */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-pilotage-metric-cell,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-kpi-card {
  position: relative;
  isolation: isolate;
  border-radius: var(--fy-radius-card) !important;
  border: 1px solid rgba(244, 123, 74, 0.18) !important;
  background: linear-gradient(155deg, #ffffff 0%, var(--fy-surface-warm) 36%, #f3ebe4 100%) !important;
  box-shadow: var(--fy-elev-kpi) !important;
  transition: transform var(--fy-duration) var(--fy-ease-out), box-shadow 0.28s ease,
    border-color 0.2s ease !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-pilotage-metric-cell::before,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.88;
  background: radial-gradient(120% 80% at 0% 0%, rgba(244, 123, 74, 0.08), transparent 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(15, 118, 110, 0.07), transparent 50%);
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-pilotage-metric-cell > *,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-kpi-card > * {
  position: relative;
  z-index: 1;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-pilotage-metric-cell:hover,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-kpi-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(244, 123, 74, 0.32) !important;
  box-shadow: var(--fy-elev-hover) !important;
}

:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-pilotage-metric-cell,
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fy-kpi-card {
  /* Neutralise les utilitaires Tailwind qui peuvent mettre bg/border sans override */
  background-color: transparent !important;
}

body.fi-panel-admin .fy-pilotage-hub,
body.fi-panel-cockpit .fy-pilotage-hub {
  --fy-hub-gap: 2rem;
}

body.fi-panel-admin .fy-pilotage-hub > .fi-section,
body.fi-panel-cockpit .fy-pilotage-hub > .fi-section {
  margin-bottom: 0.5rem;
}

body.fi-panel-admin .fy-pilotage-hub .fi-section.fy-cockpit-section,
body.fi-panel-cockpit .fy-pilotage-hub .fi-section.fy-cockpit-section {
  border-radius: var(--fy-radius-lg) !important;
  border: 1px solid rgba(244, 123, 74, 0.16) !important;
  background: linear-gradient(178deg, rgba(255, 255, 255, 0.99) 0%, #fffefb 45%, #f8f2ec 100%) !important;
  box-shadow: var(--fy-elev-2), 0 0 0 1px rgba(255, 255, 255, 0.65) inset !important;
  overflow: hidden;
  transition: box-shadow 0.25s ease, border-color 0.2s ease;
}

body.fi-panel-admin .fy-pilotage-hub .fi-section.fy-cockpit-section:hover,
body.fi-panel-cockpit .fy-pilotage-hub .fi-section.fy-cockpit-section:hover {
  box-shadow: var(--fy-elev-hover) !important;
  border-color: rgba(244, 123, 74, 0.24) !important;
}

.dark body.fi-panel-admin .fy-pilotage-hub .fi-section.fy-cockpit-section,
.dark body.fi-panel-cockpit .fy-pilotage-hub .fi-section.fy-cockpit-section {
  background: linear-gradient(178deg, rgba(38, 36, 34, 0.98) 0%, rgb(23 23 23) 100%) !important;
  border-color: rgba(244, 123, 74, 0.2) !important;
}

body.fi-panel-admin .fy-pilotage-hub .fi-section-header,
body.fi-panel-cockpit .fy-pilotage-hub .fi-section-header {
  background: linear-gradient(95deg, rgba(244, 123, 74, 0.09) 0%, rgba(15, 118, 110, 0.05) 42%, transparent 72%) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
}

body.fi-panel-admin .fy-pilotage-hub .fi-section-header-heading,
body.fi-panel-cockpit .fy-pilotage-hub .fi-section-header-heading {
  font-size: 1.0625rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  color: var(--fy-ink) !important;
}

body.fi-panel-admin .fy-pilotage-hub .fi-section-header-description,
body.fi-panel-cockpit .fy-pilotage-hub .fi-section-header-description {
  color: var(--fy-muted) !important;
  font-size: 0.9375rem !important;
  line-height: 1.5 !important;
}

.dark body.fi-panel-admin .fy-pilotage-hub .fi-section-header-heading,
.dark body.fi-panel-cockpit .fy-pilotage-hub .fi-section-header-heading {
  color: #fff !important;
}

/* Tuiles KPI pilotage : double classe + spécificité max */
body.fi-panel-admin .fy-pilotage-hub .fy-kpi-card,
body.fi-panel-admin .fy-pilotage-hub .fy-pilotage-metric-cell,
body.fi-panel-cockpit .fy-pilotage-hub .fy-kpi-card,
body.fi-panel-cockpit .fy-pilotage-hub .fy-pilotage-metric-cell {
  position: relative;
  isolation: isolate;
  border-radius: var(--fy-radius-card) !important;
  border: 1px solid rgba(244, 123, 74, 0.15) !important;
  background: linear-gradient(155deg, #ffffff 0%, var(--fy-surface-warm) 36%, #f3ebe4 100%) !important;
  box-shadow: var(--fy-elev-kpi) !important;
  transition: transform var(--fy-duration) var(--fy-ease-out), box-shadow 0.28s ease, border-color 0.2s ease !important;
}

body.fi-panel-admin .fy-pilotage-hub .fy-kpi-card::before,
body.fi-panel-admin .fy-pilotage-hub .fy-pilotage-metric-cell::before,
body.fi-panel-cockpit .fy-pilotage-hub .fy-kpi-card::before,
body.fi-panel-cockpit .fy-pilotage-hub .fy-pilotage-metric-cell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.85;
  background: radial-gradient(120% 80% at 0% 0%, rgba(244, 123, 74, 0.07), transparent 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(15, 118, 110, 0.06), transparent 50%);
}

body.fi-panel-admin .fy-pilotage-hub .fy-kpi-card > *,
body.fi-panel-admin .fy-pilotage-hub .fy-pilotage-metric-cell > *,
body.fi-panel-cockpit .fy-pilotage-hub .fy-kpi-card > *,
body.fi-panel-cockpit .fy-pilotage-hub .fy-pilotage-metric-cell > * {
  position: relative;
  z-index: 1;
}

body.fi-panel-admin .fy-pilotage-hub .fy-kpi-card:hover,
body.fi-panel-admin .fy-pilotage-hub .fy-pilotage-metric-cell:hover,
body.fi-panel-cockpit .fy-pilotage-hub .fy-kpi-card:hover,
body.fi-panel-cockpit .fy-pilotage-hub .fy-pilotage-metric-cell:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(244, 123, 74, 0.32) !important;
  box-shadow: var(--fy-elev-hover) !important;
}

.dark body.fi-panel-admin .fy-pilotage-hub .fy-kpi-card,
.dark body.fi-panel-admin .fy-pilotage-hub .fy-pilotage-metric-cell,
.dark body.fi-panel-cockpit .fy-pilotage-hub .fy-kpi-card,
.dark body.fi-panel-cockpit .fy-pilotage-hub .fy-pilotage-metric-cell {
  background: linear-gradient(155deg, rgb(42 40 38) 0%, rgb(28 27 26) 100%) !important;
  border-color: rgba(244, 123, 74, 0.18) !important;
}

body.fi-panel-admin .fy-pilotage-hub .fy-kpi-label,
body.fi-panel-cockpit .fy-pilotage-hub .fy-kpi-label {
  font-size: 0.6875rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: var(--fy-muted) !important;
}

body.fi-panel-admin .fy-pilotage-hub .fy-kpi-value,
body.fi-panel-cockpit .fy-pilotage-hub .fy-kpi-value {
  margin-top: 0.35rem !important;
  font-size: 1.125rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  color: var(--fy-ink) !important;
  line-height: 1.25 !important;
}

body.fi-panel-admin .fy-pilotage-hub .fy-kpi-value--inline,
body.fi-panel-cockpit .fy-pilotage-hub .fy-kpi-value--inline {
  margin-top: 0 !important;
}

.dark body.fi-panel-admin .fy-pilotage-hub .fy-kpi-value,
.dark body.fi-panel-cockpit .fy-pilotage-hub .fy-kpi-value {
  color: #fff !important;
}

/* Encart guidance (jours fériés, aide) */
body.fi-panel-admin .fy-pilotage-hub .fy-pilotage-callout,
body.fi-panel-cockpit .fy-pilotage-hub .fy-pilotage-callout {
  border-radius: var(--fy-radius-card) !important;
  border: 1px solid rgba(15, 118, 110, 0.2) !important;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.98) 0%, var(--fy-green-soft) 38%, #fffefb 100%) !important;
  box-shadow: var(--fy-elev-1), var(--fy-ring-inset) !important;
  padding: 1.25rem 1.35rem !important;
}

body.fi-panel-admin .fy-pilotage-hub .fy-pilotage-hub-actions .fi-btn,
body.fi-panel-cockpit .fy-pilotage-hub .fy-pilotage-hub-actions .fi-btn {
  border-radius: 0.75rem !important;
}

/* Grille pilotage : respiration */
body.fi-panel-admin .fy-pilotage-hub .fi-section-content .grid,
body.fi-panel-cockpit .fy-pilotage-hub .fi-section-content .grid {
  gap: 1rem !important;
}

@media (min-width: 1024px) {
  body.fi-panel-admin .fy-pilotage-hub .fi-section-content .grid.lg\:grid-cols-4,
  body.fi-panel-cockpit .fy-pilotage-hub .fi-section-content .grid.lg\:grid-cols-4 {
    gap: 1.125rem !important;
  }
}


/* === COCKPIT GLOBAL SIDEBAR/CONTENT NON-OVERLAP (desktop runtime) === */
@media (min-width:1024px){
  :root{
    --fy-sidebar-visible-width: 0px;
  }

  .fi-layout{
    overflow-x:hidden !important;
  }

  /* Neutralise w-screen + apply runtime-visible offset */
  .fi-main-ctn{
    min-width:0 !important;
    width:auto !important;
    max-width:none !important;
    box-sizing:border-box !important;
    margin-inline-start:var(--fy-sidebar-visible-width, 0px) !important;
    inline-size:calc(100% - var(--fy-sidebar-visible-width, 0px)) !important;
    padding-inline-start:0 !important;
  }

  [dir=rtl] .fi-main-ctn{
    margin-inline-start:0 !important;
    margin-inline-end:var(--fy-sidebar-visible-width, 0px) !important;
  }
}



/* Notifications slide-over: ensure it can render above topbar skins */
:is(body.fi-panel-admin, body.fi-panel-cockpit) .fi-topbar .fi-modal {
  z-index: 60 !important;
}

/* Phase 6.G — Fix ColorPicker popover z-index (etait sous les autres champs et clignotait) */
.fi-fo-color-picker .pcr-app,
[role="dialog"] .pcr-app,
.pcr-app {
  z-index: 99999 !important;
  position: fixed !important;
}
.fi-modal-window,
.fi-section,
.fi-fo-section,
.fi-fo-color-picker {
  overflow: visible !important;
}
.fi-fo-color-picker button {
  position: relative;
  z-index: 1;
}

/* ════ FIX SCROLL HORIZONTAL GLOBAL — 2026-05-14 ════ */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}
.fi-layout, .fi-main, .fi-main-ctn, .fi-body,
.fi-simple-layout, .fi-simple-main-ctn,
.fi-page, .fi-resource-page,
.fi-resource-pages-view-record, .fi-resource-pages-edit-record {
    overflow-x: hidden !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Tabs relation managers : scroll interne sans débordement page */
[role="tablist"] {
    overflow-x: auto !important;
    overflow-y: visible !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    max-width: 100% !important;
}
[role="tablist"]::-webkit-scrollbar { display: none !important; }
/* ════════════════════════════════════════════════════ */
