No margin concept when you buy using CNC and take delivery of shares into your demat account.
But, when you sell shares from your demat (CNC sale) the entire sale proceeds won’t be credited to you trading account on the same day of sale. I think its about 80% gets released on the same day and the rest 20% of the sale proceeds gets released to your trading account 2 days later.
From the margin perspective, it is 20% which you should have to initiate the trade. This margin can be atleast 50% in CASH component and rest in non-CASH component. So in your case, the amount would be approx 2 lakh. But during settlement you have to pay complete 10 lakh to the clearing corporation. However, to avoid this risk, most of the brokers block the entire amount of 10 lakhs (as per their RISK policy). No additional margin is needed as you are already paying the complete order value.
No impact of un-realized loss unless you have either bought them via MTF (Margin Trading Facility) or pledged them to get collateral margin.
When you sell delivery shares, you make an early pay-in (instructing the broker that you have shares and are marking them to be delivered during settlement). In that case, you get 80% of the sale value as margin benifit.