:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;
}

body {
    font-family: 'Cairo', 'Inter', system-ui, -apple-system, sans-serif;
    color: #334155;
    background-color: #f8fafc;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--sidebar-bg) !important;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar .nav-link {
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 500;
    transition: all 0.2s;
    color: #cbd5e1 !important;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff !important;
}

.sidebar .nav-link.active {
    background-color: var(--primary) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.main-content {
    background-color: #f1f5f9;
    min-width: 0;
}

.card {
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
}

.stat-card {
    border-left: 4px solid var(--primary);
}
body.rtl .stat-card {
    border-left: none;
    border-right: 4px solid var(--primary);
}

.btn {
    border-radius: 8px;
}

.badge {
    border-radius: 6px;
    padding: 5px 8px;
    font-weight: 600;
}

/* Anti-Screenshot, Anti-Copy & Content Protection */
body, .main-content, .card, table, p, span, h1, h2, h3, h4, h5, h6, img, a {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}

input, textarea, select {
    -webkit-user-select: auto !important;
    user-select: auto !important;
}

/* Hide Everything on Print & Display Copyright Notice */
@media print {
    html, body, .wrapper, .main-content, .card, .modal {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    body::before {
        content: "⚠️ المحتوى محمي بحقوق النشر - أكاديمية عرباوي التعليمية - الطباعة محظورة برمجياً";
        display: block !important;
        font-size: 24pt;
        text-align: center;
        padding-top: 150px;
        color: #d9534f;
    }
}

/* Privacy Blur Shield on Screen Capture / App Switch */
body.screen-protected .main-content,
body.screen-protected .auth-wrapper,
body.screen-protected .modal-content,
body.screen-protected #universalPreviewModal,
body.screen-protected .modal-backdrop {
    filter: blur(35px) grayscale(1) !important;
    opacity: 0.1 !important;
    pointer-events: none !important;
    transition: filter 0.12s ease, opacity 0.12s ease;
}

body.screen-protected::after {
    content: "⚠️ المحتوى محمي بحقوق النشر - تصوير الشاشة ونسخ المحتوى محظور";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.96);
    color: #fff;
    padding: 16px 28px;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
    z-index: 999999;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    text-align: center;
    border: 2px solid #f59e0b;
    direction: rtl;
}

/* Watermark Layer Styling */
.watermark-layer {
    user-select: none !important;
    -webkit-user-select: none !important;
    pointer-events: none !important;
}

/* Mobile Backdrop & Drawer */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 1040;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.sidebar-open .sidebar-backdrop {
    display: block;
    opacity: 1;
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed !important;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 1050;
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.35);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    body.rtl .sidebar {
        left: auto;
        right: -280px;
    }
    .sidebar.show {
        transform: translateX(280px);
    }
    body.rtl .sidebar.show {
        transform: translateX(-280px);
    }
}

/* Fluid responsive typography & touch targets */
@media (max-width: 576px) {
    .main-content main {
        padding: 12px !important;
    }
    .card {
        border-radius: 10px;
    }
    .table-responsive {
        border-radius: 8px;
    }
    .btn {
        padding: 6px 12px;
        font-size: 13.5px;
    }
}