/* ملف CSS الرئيسي لنظام إدارة الموارد البشرية - محسّن بالكامل مع دعم الوضع الداكن */

/* الخطوط العربية */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700&display=swap');

/* المتغيرات العامة */
:root {
    /* الألوان الرئيسية */
    --primary-color: #1a5251;    
    --secondary-color: #2d7b71;   
    --accent-color: #0d7377;      
    --light-accent: #14919b;

    /* ألوان الحالة */
    --success-color: #27ae60;     
    --warning-color: #f39c12;     
    --info-color: #3498db;         
    --danger-color: #e74c3c;       

    /* ألوان الخلفيات والنصوص الافتراضية (الوضع النهاري) */
    --light-color: #f8f9fa;       
    --lighter-color: #ecf0f1;
    --dark-color: #2c3e50;      
    --text-color: #34495e;      
    --heading-color: #1a3a52;     
    --bg-body: #f5f6fa;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --border-color: #f0f0f0;
    --border-input: #e8e8e8;
    --bg-input: #ffffff;
    --bg-table-header: linear-gradient(135deg, rgba(26, 58, 82, 0.05), rgba(45, 90, 123, 0.05));
    --bg-chat-body: #fafafa;
    --bg-bot-msg: #e8e8e8;

    /* الإعدادات العامة */
    --sidebar-width: 280px;
    --header-height: 70px;
    --transition-speed: 0.35s;
    --border-radius: 12px;
    --box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --box-shadow-hover: 0 8px 16px rgba(0,0,0,0.12);
}

/* متغيرات الوضع الداكن */
html.dark-mode {
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --bg-sidebar: #1e1e1e;
    --text-color: #e0e0e0;
    --heading-color: #ffffff;
    --light-color: #2c2c2c;
    --lighter-color: #383838;
    --border-color: #333333;
    --border-input: #444444;
    --bg-input: #2a2a2a;
    --bg-table-header: rgba(255, 255, 255, 0.05);
    --bg-chat-body: #1a1a1a;
    --bg-bot-msg: #333333;
    --box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    --box-shadow-hover: 0 8px 24px rgba(0,0,0,0.5);
}

/* =======================
   HEADER (Modern – HRMS)
======================= */

.modern-header {
    background: linear-gradient(
        135deg,
        var(--primary-color),
        var(--secondary-color),
        var(--accent-color)
    );
    height: var(--header-height);
    padding: 0 20px;
    box-shadow: var(--box-shadow-hover);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

/* =======================
   LOGO
======================= */

/* ===================================================
   تعديل كود صفحة تسجيل الدخول - نسخة جاهزة للنسخ
=================================================== */

.login-container {
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    max-width: 1000px;
    width: 100%;
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    align-items: stretch;
}

.login-info {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    padding: 40px;
    color: #ffffff; /* النص أبيض للتباين مع الخلفية الداكنة */
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    text-align: right;
    position: relative;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-info h2 { 
    font-weight: 700; 
    font-size: 2rem; 
    color: #ffffff;
    margin-bottom: 10px;
}

.login-info p { 
    color: var(--lighter-color);
    opacity: 0.9; 
    margin-bottom: 25px; 
}

/* تحسين شكل قائمة المواصفات */
.list-unstyled li {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 12px;
    text-align: right;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    flex-direction: row-reverse; /* لضمان بقاء الأيقونة على اليمين */
    transition: all 0.3s ease;
    color: #ffffff;
}

.list-unstyled li:hover { 
    background: var(--light-accent);
    transform: scale(1.05) translateX(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.login-info ul li i {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-left: 12px;
    font-size: 14px;
}

.login-form { padding: 50px 40px; }

.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo img { max-width: 120px; height: auto; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1)); }
.login-logo h3 { color: var(--primary-color); font-weight: 700; margin-top: 15px; }

.form-floating .form-control {
    border-radius: 12px;
    border: 1.5px solid var(--border-input);
    transition: all 0.3s;
    background-color: var(--bg-input);
    color: var(--text-color);
}

.form-floating .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(26, 82, 81, 0.1);
}

.btn-login {
    background: var(--primary-color);
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-weight: 600;
    font-size: 1.1rem;
    width: 100%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(26, 82, 81, 0.2);
}

.btn-login:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(26, 82, 81, 0.3);
}

@media (max-width: 991.98px) {
    .login-info { padding: 40px 20px; min-height: auto; }
    .login-form { padding: 30px 20px; }
    .login-container { max-width: 500px; flex-direction: column; }
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 0 12px rgba(0,0,0,0.1);
}

.logo-text {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 16px;
}

/* =======================
   SIDEBAR BUTTON
======================= */

.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--light-color);
    font-size: 20px;
    margin-left: 10px;
    cursor: pointer;
    transition: transform var(--transition-speed);
}

.sidebar-toggle:hover {
    transform: scale(1.1);
}

/* =======================
   ICON BUTTON (Notifications)
======================= */

.icon-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: var(--light-color);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    position: relative;
    transition: all var(--transition-speed);
}

.icon-btn:hover {
    background: rgba(255,255,255,0.28);
    transform: translateY(-2px);
}

/* =======================
   NOTIFICATION BADGE
======================= */

.notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger-color);
    color: #fff;
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0,0,0,.25);
}

/* =======================
   USER MENU
======================= */

.user-box {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--light-color);
    transition: opacity var(--transition-speed);
}

.user-box:hover {
    opacity: 0.85;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--info-color),
        var(--accent-color)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    box-shadow: var(--box-shadow);
}
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(
        135deg,
        var(--primary-color),
        var(--secondary-color),
        var(--accent-color)
    );
    box-shadow: var(--box-shadow-hover);
    z-index: 1000;
    color: white;
    transition: all var(--transition-speed) ease;
    width: 100%;
}

.header .logo-text,
.header i,
.header span {
    color: white;
}

.header .btn,
.header .dropdown-menu {
    border-radius: var(--border-radius);
}
/* ===== User Menu Icons Colors ===== */

.user-menu .dropdown-item i {
    width: 18px;
    text-align: center;
    margin-left: 6px;
    color: var(--text-color);
    transition: color var(--transition-speed), transform var(--transition-speed);
}

/* Profile */
.user-menu .dropdown-item i.fa-user {
    color: var(--info-color);
}

/* Settings */
.user-menu .dropdown-item i.fa-cog {
    color: var(--secondary-color);
}

/* Customize Colors */
.user-menu .dropdown-item i.fa-palette {
    color: var(--accent-color);
}

/* Browser Permissions */
.user-menu .dropdown-item i.fa-hand-pointer {
    color: var(--warning-color);
}

/* Logout */
.user-menu .dropdown-item i.fa-sign-out-alt {
    color: var(--danger-color);
}

/* Hover Effect */
.user-menu .dropdown-item:hover i {
    transform: scale(1.15);
    filter: brightness(1.2);
}

/* =======================
   ANIMATIONS
======================= */

@keyframes gradientMove {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 2. الإعدادات العامة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'JF Flat', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}
/* الاسم المختصر مخفي افتراضياً */
.logo .short-name {
    display: none;
}

/* الاسم الكامل يظهر دائماً */
.logo .full-name {
    display: inline;
    font-weight: 600;
}

/* الشاشات الصغيرة (مثلاً أقل من 768px) */
@media (max-width: 768px) {
    .logo .full-name {
        display: none; /* نخفي الاسم الكامل */
    }

    .logo .short-name {
        display: inline-block; /* نعرض الاسم المختصر */
        font-weight: 700;
        letter-spacing: 1px;
    }
}

html {
    scroll-behavior: smooth;
}

body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
    background-color: var(--bg-body);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

/* 3. استثناء الأيقونات */
.fas, .far, .fab, .fa, [class^="fa-"], .menu-icon, i {
    font-family: 'Font Awesome 5 Free', 'Font Awesome 5 Brands', 'FontAwesome' !important;
}

.custom-card-bg {
    background-color: var(--primary-color) !important; 
    border-color: var(--primary-color) !important;
}

.custom-card-bg .text-white, 
.custom-card-bg a,
.custom-card-bg i {
    color: #fff !important;
}

/* ==================================== */
/* 🤖 زر الدردشة العائم */
/* ==================================== */
.floating-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--light-accent));
    color: white;
    text-align: center;
    line-height: 60px;
    font-size: 24px;
    box-shadow: var(--box-shadow-hover);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: none;
    cursor: pointer;
}

.floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 24px rgba(13, 115, 119, 0.4);
}

.floating-btn:active {
    transform: scale(0.95);
}

/* ==================================== */
/* 💬 نافذة الدردشة المنبثقة */
/* ==================================== */
.chat-popup {
    position: fixed;
    bottom: 90px;
    left: 20px;
    width: 350px;
    height: 450px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-popup.active {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-popup-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-popup-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.chat-popup-body {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background: var(--bg-chat-body);
}

.chat-popup-footer {
    display: flex;
    padding: 10px;
    border-top: 1px solid var(--border-color);
    gap: 8px;
}

.chat-popup-input {
    flex-grow: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-input);
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.3s ease;
    background-color: var(--bg-input);
    color: var(--text-color);
}

.chat-popup-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.1);
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    margin-bottom: 10px;
    max-width: 85%;
    line-height: 1.4;
    font-size: 13px;
}

.bot-message {
    background-color: var(--bg-bot-msg);
    color: var(--text-color);
    margin-right: auto;
}

.user-message {
    background: linear-gradient(135deg, var(--accent-color), var(--light-accent));
    color: white;
    margin-left: auto;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease;
}

.close-btn:hover {
    transform: rotate(90deg);
}

/* ==================================== */
/* ⏰ الساعة العائمة */
/* ==================================== */
.floating-clock {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--box-shadow-hover);
    letter-spacing: 0.5px;
}

/* الهيدر الاحترافي */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 20px;
    width: 100%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
}

.logo i {
    font-size: 28px;
    color: white;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-menu {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all var(--transition-speed) ease;
}

.user-info:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
}

/* القائمة الجانبية الاحترافية */
.sidebar {
    position: fixed;
    top: var(--header-height);
    right: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--bg-sidebar);
    box-shadow: var(--box-shadow-hover);
    z-index: 999;
    overflow-y: auto;
    transition: transform var(--transition-speed) ease, background-color 0.3s;
    transform: translateX(0);
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, rgba(26, 58, 82, 0.05), rgba(45, 90, 123, 0.05));
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 12px 10px;
    margin: 0;
}

.menu-item {
    margin-bottom: 8px;
}

/* أزرار القائمة الجانبية - تصميم احترافي */
.menu-link {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    color: var(--text-color);
    text-decoration: none;
    transition: all var(--transition-speed) cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    font-weight: 500;
    gap: 10px;
}

.menu-link:hover {
    background: linear-gradient(135deg, rgba(13, 115, 119, 0.08), rgba(20, 145, 155, 0.08));
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateX(-3px);
    box-shadow: 0 4px 10px rgba(13, 115, 119, 0.12);
}

.menu-link:active {
    transform: translateX(-1px);
}

.menu-link.active {
    background: linear-gradient(135deg, var(--accent-color), var(--light-accent));
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 6px 14px rgba(13, 115, 119, 0.2);
}

.menu-link.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: white;
    border-radius: 0 4px 4px 0;
}

.menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.menu-link:hover .menu-icon {
    transform: scale(1.1);
}

.menu-text {
    font-weight: 500;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* المحتوى الرئيسي - الحل الأساسي لمشكلة الهيدر */
.main-content {
    flex: 1;
    padding: 0;
    transition: margin-right var(--transition-speed) ease;
    min-height: calc(100vh - var(--header-height));
    margin-right: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    overflow-x: hidden;
    margin-top: var(--header-height);
    display: flex;
    flex-direction: column;
}

.main-content.sidebar-open {
    margin-right: var(--sidebar-width);
}

/* قسم البطل */
.hero-section {
    position: relative;
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 0;
    padding-top: 0;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: brightness(0.75);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.4);
}

.hero-content {
    position: relative;
    text-align: center;
    color: white;
    z-index: 2;
    animation: fadeInDown 0.8s ease-out;
    max-width: 90%;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -1px;
    color: white;
}

.hero-subtitle {
    font-size: 16px;
    font-weight: 400;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
    color: white;
}

/* منطقة المحتوى - الحل الأساسي */
.content-area {
    padding: 30px;
    width: 100%;
    max-width: 100%;
    flex: 1;
}

.page-header {
    margin-bottom: 30px;
    animation: fadeInUp 0.6s ease-out;
    margin-top: 0;
    padding-top: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    margin-top: 0;
    padding-top: 0;
}

html.dark-mode .page-title {
    color: var(--heading-color);
}

.page-subtitle {
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 400;
}

/* البطاقات الاحترافية */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    overflow: hidden;
    transition: all var(--transition-speed) cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border-color);
    width: 100%;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--box-shadow-hover);
    border-color: var(--accent-color);
}

.card-header {
    padding: 20px;
    background: linear-gradient(135deg, rgba(26, 58, 82, 0.03), rgba(45, 90, 123, 0.03));
    border-bottom: 2px solid var(--border-color);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    letter-spacing: -0.3px;
}

html.dark-mode .card-title {
    color: var(--heading-color);
}

.card-body {
    padding: 20px;
}

/* الأزرار الاحترافية */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-speed) cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), var(--light-accent));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0a5f63, #0d7377);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #229954);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #1e8449, #1a7d3a);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #e67e22);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d68910, #d35400);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #c0392b);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #cb4335, #a93226);
}

/* الجداول */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
}

.table {
    width: 100%;
    background: var(--bg-card);
    border-collapse: collapse;
    margin: 0;
}

.table th,
.table td {
    padding: 14px 12px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.table th {
    background: var(--bg-table-header);
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.3px;
}

html.dark-mode .table th {
    color: var(--heading-color);
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(13, 115, 119, 0.05);
}

/* النماذج */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: 0.2px;
    font-size: 13px;
}

html.dark-mode .form-label {
    color: var(--heading-color);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-input);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    transition: all var(--transition-speed) ease;
    background: var(--bg-input);
    color: var(--text-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.08);
    background: var(--bg-input);
}

.form-control:hover {
    border-color: var(--accent-color);
}

/* التنبيهات */
.alert {
    padding: 14px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    border-left: 4px solid;
    font-size: 13px;
}

.alert-success {
    background: #d4edda;
    border-color: var(--success-color);
    color: #155724;
}

.alert-warning {
    background: #fff3cd;
    border-color: var(--warning-color);
    color: #856404;
}

.alert-danger {
    background: #f8d7da;
    border-color: var(--danger-color);
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border-color: var(--info-color);
    color: #0c5460;
}

/* خلفية التراكب */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed) ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* الزر العائم المتقدم */
.fab-container-left {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 40;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 12px;
}

.fab-main-button {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 22px;
    box-shadow: var(--box-shadow-hover);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: none;
}

.fab-main-button:hover {
    transform: scale(1.1);
}

.fab-options-up {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.fab-container-left.active .fab-options-up {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-container-left.active .fab-main-button {
    transform: rotate(45deg);
    background: linear-gradient(135deg, var(--accent-color), var(--light-accent));
}

.fab-item-small {
    width: 48px;
    height: 48px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary-color);
    font-size: 18px;
    box-shadow: var(--box-shadow-hover);
    text-decoration: none;
    transition: all 0.2s ease;
    border: 2px solid var(--border-color);
}

html.dark-mode .fab-item-small {
    color: var(--heading-color);
}

.fab-item-small:hover {
    background: linear-gradient(135deg, var(--accent-color), var(--light-accent));
    color: white;
    transform: scale(1.1);
    border-color: var(--accent-color);
}

.logout-color:hover {
    background: linear-gradient(135deg, var(--danger-color), #c0392b) !important;
    color: white !important;
}

/* الحركات والتأثيرات */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* تنسيق القوائم الفرعية */
.submenu {
    padding-right: 0;
}

.submenu-item {
    list-style: none;
}

.submenu-link {
    display: block;
    padding: 8px 12px 8px 26px;
    text-decoration: none;
    color: var(--text-color);
    background-color: transparent;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 4px 0;
    font-size: 13px;
}

.submenu-link:hover {
    background-color: rgba(13, 115, 119, 0.08);
    color: var(--accent-color);
}

/* تحسينات الطباعة */
@media print {
    .header,
    .sidebar,
    .sidebar-overlay,
    .floating-btn,
    .chat-popup,
    .floating-clock,
    .fab-container-left {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        width: 100% !important;
        margin-top: 0 !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* الاستجابة للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    :root {
        --sidebar-width: 100%;
        --header-height: 60px;
    }

    .header {
        height: 60px;
    }

    .header-content {
        padding: 0 15px;
    }

    .logo {
        font-size: 18px;
    }

    .logo i {
        font-size: 24px;
    }

    .sidebar {
        width: 100%;
        transform: translateX(100%);
        top: 60px;
        height: calc(100vh - 60px);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
        width: 100%;
        margin-top: 60px;
    }

    .content-area {
        padding: 15px;
    }

    .page-header {
        margin-top: 0;
        padding-top: 0;
    }

    .page-title {
        margin-top: 0;
        padding-top: 0;
    }

    .hero-title {
        font-size: 24px;
    }

    .hero-subtitle {
        font-size: 13px;
    }

    .page-title {
        font-size: 20px;
    }

    .page-subtitle {
        font-size: 12px;
    }

    .btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    .card {
        margin-bottom: 12px;
    }

    .card-header {
        padding: 15px;
    }

    .card-body {
        padding: 15px;
    }

    .card-title {
        font-size: 16px;
    }

    .table th,
    .table td {
        padding: 10px 8px;
        font-size: 11px;
    }

    .form-label {
        font-size: 12px;
    }

    .form-control {
        padding: 8px 12px;
        font-size: 12px;
    }

    .menu-link {
        padding: 10px 12px;
        font-size: 13px;
    }

    .menu-text {
        font-size: 13px;
    }

    .user-info span {
        display: none;
    }

    .floating-btn,
    .floating-clock {
        bottom: 10px;
        font-size: 11px;
    }

    .floating-btn {
        width: 50px;
        height: 50px;
        line-height: 50px;
        font-size: 20px;
    }

    .chat-popup {
        width: calc(100% - 40px);
        height: 300px;
        bottom: 60px;
        left: 20px;
        right: 20px;
    }
}

/* الاستجابة للأجهزة الصغيرة */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
        --header-height: 65px;
    }

    .sidebar {
        width: var(--sidebar-width);
        transform: translateX(100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
        width: 100%;
        margin-top: 65px;
    }

    .content-area {
        padding: 20px;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 15px;
    }

    .page-title {
        font-size: 24px;
    }

    .sidebar-toggle {
        display: flex;
    }

    .logo {
        font-size: 20px;
    }
}

/* الاستجابة للأجهزة المتوسطة */
@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --sidebar-width: 260px;
    }

    .sidebar {
        width: var(--sidebar-width);
    }

    .main-content {
        margin-right: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
        margin-top: var(--header-height);
    }

    .content-area {
        padding: 25px;
    }

    .hero-title {
        font-size: 38px;
    }

    .page-title {
        font-size: 26px;
    }
}

/* الاستجابة للأجهزة الكبيرة */
@media (min-width: 1025px) {
    .sidebar {
        position: fixed;
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: none;
    }

    .sidebar-overlay {
        display: none;
    }

    .main-content {
        margin-right: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
        margin-top: var(--header-height);
    }
}

/* الاستجابة للشاشات الكبيرة جداً */
@media (min-width: 1400px) {
    .content-area {
        padding: 40px;
        max-width: 1400px;
        margin: 0 auto;
    }

    .hero-title {
        font-size: 52px;
    }

    .page-title {
        font-size: 32px;
    }
}

/* دعم تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
