/* ─── Filament Profile Menu Fix (SmartAvocat) ─── */

/* 1. رفع طبقة الشريط العلوي والقائمة لضمان الظهور فوق الخلفية الرمادية */
.fi-topbar {
    z-index: 45 !important;
}

.fi-dropdown-panel {
    z-index: 9999 !important;
    /* التأكد من عدم وجود حد أقصى للطول يسبب قص القائمة */
    max-height: calc(100vh - 100px) !important;
    overflow-y: auto !important;
}

/* 2. ضمان أن محتوى القائمة (بما فيه تسجيل الخروج) يظهر بالكامل */
.fi-dropdown-list {
    padding-bottom: 8px !important;
}

/* 3. إصلاح وضعية الموبايل بشكل خاص */
@media (max-width: 640px) {
    .fi-topbar {
        z-index: 55 !important;
    }
    .fi-dropdown-panel {
        z-index: 10000 !important;
        position: fixed !important;
        top: 60px !important;
        right: 10px !important;
    }
}

/* 4. إصلاح ظهور النوافذ المنبثقة (Modals) في نسخة الهاتف */
.fi-modal {
    z-index: 10000 !important;
}

.fi-modal-window {
    z-index: 10001 !important;
}

/* Ensure the modal container is above everything but below the window */
.fi-modal-container {
    z-index: 9999 !important;
}

@media (max-width: 640px) {
    .fi-modal-window {
        margin: 1rem !important;
        max-height: calc(100vh - 2rem) !important;
        z-index: 100001 !important; /* Extremely high for mobile */
    }
    
    .fi-modal-container {
        z-index: 100000 !important;
    }

    /* Fix for when the modal is inside a relative container */
    .fi-main-ctn, .fi-main {
        z-index: auto !important;
    }
}

/* =========================================================
   SmartAvocat — Filament custom styles
   ========================================================= */

/* ── Typographie globale ─────────────────────────────────── */
body {
    font-family: 'Inter', 'Alexandria', sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Custom Dashboard / Cards ────────────────────────────── */
.fi-section {
    border-radius: 12px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
}

.fi-sidebar {
    border-inline-end: 1px solid rgba(0,0,0,0.05) !important;
}

/* ── Fix for Profile menu visibility in Mobile ────────────── */
@media (max-width: 768px) {
    .fi-topbar-item-dropdown {
        position: static !important;
    }
    .fi-dropdown-panel {
        width: 220px !important;
    }
}
