@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

:root {
    --primary-color: #2563EB;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --bg-color: #F8FAFC;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-color);
    direction: rtl;
    text-align: right;
}

.sidebar {
    height: 100vh;
    background-color: #ffffff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.05);
    position: fixed;
    right: 0;
    top: 0;
    width: 260px;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-header h3 {
    color: var(--primary-color);
    font-weight: 700;
    margin: 0;
}

.sidebar-menu {
    padding: 10px 0;
}

.sidebar-menu a {
    padding: 12px 25px;
    text-decoration: none;
    font-size: 16px;
    color: #4b5563;
    display: block;
    transition: 0.2s;
    font-weight: 600;
}

.sidebar-menu a i {
    margin-left: 10px;
    width: 20px;
    text-align: center;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: #eff6ff;
    color: var(--primary-color);
    border-right: 4px solid var(--primary-color);
}

.main-content {
    margin-right: 260px;
    min-height: 100vh;
}

.top-navbar {
    background-color: #ffffff;
    height: 70px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}

.content-wrapper {
    padding: 30px;
}

/* Custom Buttons */
.btn-primary { background-color: var(--primary-color); border-color: var(--primary-color); }
.btn-primary:hover { background-color: #1d4ed8; border-color: #1d4ed8; }
.btn-success { background-color: var(--success-color); border-color: var(--success-color); }
.btn-warning { background-color: var(--warning-color); border-color: var(--warning-color); color: white; }
.btn-danger { background-color: var(--danger-color); border-color: var(--danger-color); }

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 15px 20px;
    font-weight: 700;
    color: #1e293b;
}

/* Responsive Sidebar & Mobile Layout Styling */
.sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.5); /* semi-transparent slate */
    backdrop-filter: blur(4px); /* premium glassmorphic blur */
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(260px); /* Hide completely to the right */
        box-shadow: none;
    }
    
    .sidebar.show {
        transform: translateX(0);
        box-shadow: -5px 0 25px rgba(0,0,0,0.15);
    }
    
    .main-content {
        margin-right: 0 !important;
    }
    
    .top-navbar {
        padding: 0 15px;
    }
    
    .content-wrapper {
        padding: 15px;
    }
    
    /* Make dashboard cards list vertically with nicer padding */
    .card-body.py-4 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    /* Responsive Table to Cards Transformation */
    .table-cards-mobile, 
    .table-cards-mobile tbody, 
    .table-cards-mobile tr, 
    .table-cards-mobile td {
        display: block !important;
        width: 100% !important;
    }
    
    .table-cards-mobile thead {
        display: none !important;
    }
    
    .table-cards-mobile tr {
        background-color: #ffffff;
        border-radius: 12px;
        margin-bottom: 16px;
        padding: 16px;
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    }
    
    .table-cards-mobile td {
        text-align: left !important;
        padding: 10px 0 !important;
        border: none !important;
        border-bottom: 1px dashed #e2e8f0 !important;
        display: flex !important;
        justify-content: space-between;
        align-items: center;
    }
    
    .table-cards-mobile td:last-child {
        border-bottom: none !important;
        margin-top: 12px;
        padding-top: 12px !important;
        justify-content: flex-end;
        gap: 8px;
    }
    
    .table-cards-mobile td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #475569;
        font-size: 13px;
        margin-left: 15px;
        text-align: right;
    }
}