@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

/* Global Fonts Update as requested */
body,
.login-wrap,
.login-container {
    font-family: 'bahij', 'IBM Plex Sans Arabic', sans-serif !important;
}

/* Login Form Styles */
.login-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    background-color: var(--kt-card-bg, #ffffff);
    border: 1px solid var(--kt-border-color, #e4e6ef);
}

.dark .login-card {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    background-color: var(--kt-card-bg, #18181b);
    border-color: var(--kt-border-color, #27272a);
}

.login-title {
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--kt-text-foreground);
}

.login-subtitle {
    color: var(--kt-text-muted-foreground);
    margin-bottom: 2rem;
}

/* Animations */
@keyframes loginFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-login {
    animation: loginFadeIn 0.5s ease-out forwards;
}

/* Input Wrappers */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    right: 1rem;
    /* RTL Layout */
    color: var(--kt-text-muted-foreground);
    font-size: 1.25rem;
}

.input-with-icon input {
    padding-right: 2.75rem;
}

/* Button Spinner */
.btn-spinner {
    display: none;
    position: absolute;
}

.is-loading .btn-text {
    visibility: hidden;
}

.is-loading .btn-spinner {
    display: block;
}

.kt-menu-title {
    font-size: 15px !important;
    font-family: 'bahij';
    font-weight: 100 !important;
}

/* 403 Error Page Styles */
.error-403-container {
    min-height: 85vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

.error-403-title {
    color: #f1416c !important;
    font-size: 2.25rem !important; /* Smaller size */
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.25rem;
}

.error-403-desc {
    color: var(--kt-text-muted-foreground, #6b7280);
    font-size: 1.1rem; /* Smaller size */
    font-weight: 500;
    margin-bottom: 2rem;
}

.error-403-btn {
    font-size: 1rem;
    padding: 0.75rem 2rem;
    font-weight: 600;
}

/* User Menu Permissions Styles*/
.font-bahij {
    font-family: 'bahij', 'IBM Plex Sans Arabic', sans-serif !important;
}
.perm-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
}
.perm-card-wrapper {
    flex: 1 1 calc(33.333% - 1.5rem);
    min-width: 320px;
    display: flex;
    flex-direction: column;
}
.perm-card {
    transition: all 0.3s ease;
    border: 1px solid var(--tw-gray-200, #e5e7eb);
    border-radius: 0.75rem;
    background-color: white;
    overflow: hidden;
    height: 100%;
}
.perm-card:hover {
    border-color: var(--tw-primary-light, rgba(0, 163, 255, 0.2));
    box-shadow: 0 10px 30px -5px rgba(0,0,0,0.05);
}

/* Safely replace uncompiled JIT background classes */
.bg-header-light { background-color: rgba(249, 250, 251, 0.8); }
.bg-header-light:hover { background-color: rgba(243, 244, 246, 0.8); }
.bg-primary-light-custom { background-color: rgba(0, 163, 255, 0.05); }
.bg-white-transparent { background-color: rgba(255, 255, 255, 0.95); }
.border-primary-light { border-color: rgba(0, 163, 255, 0.2); }
.shadow-primary-custom { box-shadow: 0 4px 6px -1px rgba(0, 163, 255, 0.3); }
.shadow-primary-custom:hover { box-shadow: 0 10px 15px -3px rgba(0, 163, 255, 0.5); }
.backdrop-blur { backdrop-filter: blur(12px); }

.card-header-toggle {
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.card-header-toggle:hover {
    background-color: var(--tw-gray-50, #f9fafb);
}
.perm-item {
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem;
    cursor: pointer;
    border-bottom: 1px solid #efefef;
}
.perm-item:hover {
    background-color: var(--tw-gray-100, #f3f4f6);
}
.card-collapse-icon {
    transition: transform 0.3s ease;
}
.card-collapsed .card-collapse-icon {
    transform: rotate(180deg);
}
.card-collapsed .card-body-wrapper {
    display: none;
}
.checkbox-custom .checkbox {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.375rem;
}

.scroll-container {
    max-height: 340px;
    overflow-y: auto;
}
/* Scrollbar for limited height containers */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--tw-gray-300, #d1d5db);
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--tw-gray-400, #9ca3af);
}
.rounded-full { background: #dadada; }