:root {
    --primary: #4361ee;
    --primary-hover: #3a0ca3;
    --secondary: #4cc9f0;
    --success: #4caf50;
    --danger: #f72585;
    --warning: #ff9800;
    --dark: #2b2d42;
    --light: #f8f9fa;
    --gray: #8d99ae;
    --bg: #edf2f4;
    --surface: #ffffff;
    
    --font-family: 'Cairo', sans-serif;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow: 0 10px 30px rgba(0,0,0,0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg);
    color: var(--dark);
    direction: rtl; /* Arabic RTL */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1) 0%, rgba(76, 201, 240, 0.1) 100%);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--primary);
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.2;
    top: -100px;
    right: -100px;
}

.auth-container::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--secondary);
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
    bottom: -50px;
    left: -50px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 3rem;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    position: relative;
    z-index: 10;
    animation: slideUp 0.6s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.auth-header p {
    color: var(--gray);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}

.btn {
    width: auto;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}

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

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: none;
}

.alert-danger {
    background-color: rgba(247, 37, 133, 0.1);
    color: var(--danger);
    border: 1px solid rgba(247, 37, 133, 0.2);
}

/* Dashboard Base */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    width: 100%;
}

.table-container {
    overflow-x: auto;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        right: -260px; /* Arabic RTL, so right instead of left */
        height: 100vh;
        z-index: 1000;
        transition: right 0.3s ease;
    }
    
    .sidebar.open {
        right: 0;
    }

    .main-content {
        padding: 1rem;
    }

    .top-header {
        padding: 1rem;
    }

    .menu-toggle {
        display: block;
    }

    /* Modal responsiveness */
    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
}

/* Global Layout Elements (Moved from Inline) */
.sidebar-logo {
    font-size: 2rem;
    color: var(--primary);
    font-weight: 800;
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: var(--gray);
    text-decoration: none;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    transition: var(--transition);
    font-weight: 600;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.nav-item i {
    width: 30px;
    font-size: 1.2rem;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--surface);
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center; justify-content: center;
    z-index: 1000;
}
.modal {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%; max-width: 500px;
    box-shadow: var(--shadow);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}
.btn-block {
    width: 100%;
}

