/*
 * Habillage KEYA du panel Filament (chargé par AdminPanelProvider via le
 * render hook HEAD_END). Filament v3 compile son propre Tailwind 3, alors
 * que l'application est en Tailwind 4 : plutôt qu'un thème Vite séparé, on
 * surcharge ici ses classes stables `fi-*`. Couleurs = jetons rose-keya /
 * vert-keya de resources/css/app.css ; le rose domine, le vert ponctue.
 */

:root {
    --keya-rose-50: #fdf2f7;
    --keya-rose-100: #fce7f1;
    --keya-rose-400: #f472ab;
    --keya-rose-500: #ec4189;
    --keya-rose-600: #e61873;
    --keya-rose-700: #c00f5c;
    --keya-rose-900: #841344;
    --keya-vert-300: #82d2a7;
    --keya-vert-400: #4db781;
    --keya-vert-500: #2a9c66;
    --keya-vert-600: #1c7e51;
    --keya-degrade: linear-gradient(135deg, var(--keya-rose-600) 0%, var(--keya-rose-500) 60%, var(--keya-rose-400) 100%);
    --keya-degrade-vert: linear-gradient(135deg, var(--keya-vert-600) 0%, var(--keya-vert-500) 55%, var(--keya-vert-400) 100%);
}

/* ---------- Fond général ---------- */
.fi-body:not(.dark *) {
    background:
        radial-gradient(60rem 30rem at 100% -10%, rgba(230, 24, 115, 0.08), transparent 60%),
        radial-gradient(40rem 25rem at -10% 110%, rgba(42, 156, 102, 0.07), transparent 60%),
        #fdf8fb;
    background-attachment: fixed;
}

/* ---------- Page de connexion ---------- */
.fi-simple-layout {
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.18) 0 8rem, transparent 8rem),
        radial-gradient(circle at 90% 92%, var(--keya-vert-500) 0 9rem, rgba(255, 255, 255, 0.15) 9rem 10rem, transparent 10rem),
        var(--keya-degrade);
}

.fi-simple-main {
    border-radius: 1.75rem !important;
    box-shadow: 0 30px 60px -20px rgba(132, 19, 68, 0.45) !important;
}

.fi-simple-header-heading {
    color: var(--keya-rose-600);
}

/* ---------- Barre latérale : panneau rose flottant ---------- */
@media (min-width: 1024px) {
    .fi-sidebar-nav {
        margin: 0.75rem;
        border-radius: 1.5rem;
        box-shadow: 0 20px 40px -18px rgba(230, 24, 115, 0.55);
    }
}

/* Le point vert (rappel des points du logo) est une couche de fond et non
   un ::after positionné, qui flotterait par-dessus les entrées quand la nav
   défile. Avec background-attachment: local, il est attaché à la fin du
   contenu défilant et occupe la marge basse réservée (padding-bottom) : il
   ne chevauche jamais une entrée du menu. Aplat net : un vert flouté sur le
   rose virerait au gris. */
.fi-sidebar-nav {
    overflow-x: hidden;
    background:
        radial-gradient(circle at 100% 100%, var(--keya-vert-500) 0 3.25rem, rgba(255, 255, 255, 0.12) 3.25rem 4rem, transparent 4rem),
        linear-gradient(180deg, var(--keya-rose-600) 0%, var(--keya-rose-700) 100%);
    background-attachment: local;
    padding-bottom: 4.5rem !important;
}

.fi-sidebar-nav .fi-sidebar-item-label,
.fi-sidebar-nav .fi-sidebar-item-icon,
.fi-sidebar-nav .fi-sidebar-group-icon {
    color: rgba(255, 255, 255, 0.92) !important;
}

.fi-sidebar-nav .fi-sidebar-group-label {
    color: rgba(255, 255, 255, 0.7) !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.7rem !important;
}

.fi-sidebar-nav .fi-sidebar-group-collapse-button,
.fi-sidebar-nav .fi-sidebar-group-collapse-button svg {
    color: rgba(255, 255, 255, 0.7) !important;
}

.fi-sidebar-nav .fi-sidebar-item-button {
    border-radius: 0.875rem !important;
}

.fi-sidebar-nav .fi-sidebar-item-button:hover,
.fi-sidebar-nav .fi-sidebar-item-button:focus-visible {
    background: rgba(255, 255, 255, 0.14) !important;
}

.fi-sidebar-nav .fi-sidebar-item-active .fi-sidebar-item-button {
    background: #fff !important;
    box-shadow: 0 8px 20px -8px rgba(80, 4, 37, 0.45);
}

.fi-sidebar-nav .fi-sidebar-item-active .fi-sidebar-item-label,
.fi-sidebar-nav .fi-sidebar-item-active .fi-sidebar-item-icon {
    color: var(--keya-rose-600) !important;
}

.fi-sidebar-nav .fi-sidebar-item-grouped-border div {
    background-color: rgba(255, 255, 255, 0.4) !important;
}

.fi-sidebar-nav .fi-badge {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    --tw-ring-color: rgba(255, 255, 255, 0.3) !important;
}

.fi-sidebar-nav .fi-sidebar-item-active .fi-badge {
    background: var(--keya-vert-500) !important;
}

/* ---------- Titres de page ---------- */
.fi-header-heading {
    background: linear-gradient(90deg, var(--keya-rose-700), var(--keya-rose-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
}

/* ---------- Boutons principaux ---------- */
.fi-btn.fi-color-primary:not(.fi-btn-outlined):not(.fi-link) {
    background-image: linear-gradient(90deg, var(--keya-rose-600), var(--keya-rose-500));
    box-shadow: 0 10px 22px -10px rgba(230, 24, 115, 0.7);
    border-radius: 0.75rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fi-btn.fi-color-primary:not(.fi-btn-outlined):not(.fi-link):hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px -10px rgba(230, 24, 115, 0.75);
}

/* ---------- Cartes : sections, tableaux, widgets ---------- */
.fi-section,
.fi-ta-ctn,
.fi-wi-stats-overview-stat,
.fi-wi-widget > .fi-section {
    border-radius: 1.25rem !important;
}

.fi-body:not(.dark *) .fi-section,
.fi-body:not(.dark *) .fi-ta-ctn {
    box-shadow: 0 12px 30px -18px rgba(132, 19, 68, 0.25) !important;
}

/* Indicateurs du tableau de bord : alternance rose plein / blanc / vert plein */
.fi-wi-stats-overview-stat {
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fi-wi-stats-overview-stat:hover {
    transform: translateY(-2px);
}

.fi-wi-stats-overview-stat:nth-child(3n + 1),
.fi-wi-stats-overview-stat:nth-child(3n) {
    border: 0;
    --tw-ring-color: transparent !important;
}

.fi-wi-stats-overview-stat:nth-child(3n + 1) {
    background: var(--keya-degrade) !important;
    box-shadow: 0 16px 30px -16px rgba(230, 24, 115, 0.7) !important;
}

.fi-wi-stats-overview-stat:nth-child(3n) {
    background: var(--keya-degrade-vert) !important;
    box-shadow: 0 16px 30px -16px rgba(28, 126, 81, 0.6) !important;
}

.fi-wi-stats-overview-stat:nth-child(3n + 1) *,
.fi-wi-stats-overview-stat:nth-child(3n) * {
    color: #fff !important;
}

.fi-wi-stats-overview-stat:nth-child(3n + 1) .fi-wi-stats-overview-stat-label,
.fi-wi-stats-overview-stat:nth-child(3n) .fi-wi-stats-overview-stat-label,
.fi-wi-stats-overview-stat:nth-child(3n + 1) .fi-wi-stats-overview-stat-description,
.fi-wi-stats-overview-stat:nth-child(3n) .fi-wi-stats-overview-stat-description {
    color: rgba(255, 255, 255, 0.85) !important;
}

.fi-wi-stats-overview-stat:nth-child(3n + 2) {
    border-top: 4px solid var(--keya-rose-500);
}

.fi-wi-stats-overview-stat:nth-child(3n + 2) .fi-wi-stats-overview-stat-value {
    color: var(--keya-rose-600) !important;
}

.fi-wi-stats-overview-stat::after {
    content: '';
    position: absolute;
    top: -2.5rem;
    right: -2.5rem;
    width: 7rem;
    height: 7rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.14);
    pointer-events: none;
}
