/* ==========================================================================
   منصة مستر نوفل — نظام التصميم الموحد (Theme)
   Lab Blue Classic  |  مدرس: أ. مصطفي نوفل  |  تخصص: كيمياء
   ========================================================================== */

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

/* --------------------------------------------------------------------------
   1. المتغيرات (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
    /* الألوان الأساسية */
    --primary:        #0ea5e9;
    --primary-dark:   #0369a1;
    --primary-deep:   #075985;
    --primary-soft:   rgba(14, 165, 233, .14);
    --primary-glow:   rgba(14, 165, 233, .38);

    --secondary:      #38bdf8;
    --secondary-soft: rgba(56, 189, 248, .14);

    /* ⚠️ --accent في الكود الأصلي = سماوي (مش أحمر) — متغير --pink للإحمرار */
    --accent:         #38bdf8;
    --accent-soft:    rgba(56, 189, 248, .14);

    --pink:           #f43f5e;
    --pink-soft:      rgba(244, 63, 94, .14);
    --pink-glow:      rgba(244, 63, 94, .28);

    --success:        #22c55e;
    --success-soft:   rgba(34, 197, 94, .14);
    --warning:        #f59e0b;
    --warning-soft:   rgba(245, 158, 11, .14);
    --error:          #ef4444;
    --error-soft:     rgba(239, 68, 68, .14);
    --info:           #38bdf8;
    --info-soft:      rgba(56, 189, 248, .14);

    /* الخلفيات */
    --bg-1:           #0c1222;
    --bg-2:           #111c33;
    --bg-3:           #16233f;
    --grad-1:         #0c1222;
    --grad-2:         #123a63;
    --grad-3:         #0c1222;

    /* الأسطح */
    --surface:        rgba(255, 255, 255, .06);
    --surface-2:      rgba(255, 255, 255, .09);
    --surface-3:      rgba(255, 255, 255, .13);
    --border:         rgba(255, 255, 255, .12);
    --border-strong:  rgba(255, 255, 255, .22);

    /* النصوص */
    --text:           #eaf2ff;
    --text-soft:      #c3d4ee;
    --text-muted:     #8fa3c4;
    --text-dim:       #64748b;
    --on-primary:     #04121f;

    /* الشكل */
    --radius-xs:      8px;
    --radius-sm:      12px;
    --radius:         16px;
    --radius-lg:      22px;
    --radius-xl:      30px;
    --radius-pill:    999px;

    /* الظلال */
    --shadow-sm:      0 4px 14px rgba(0, 0, 0, .22);
    --shadow:         0 14px 34px rgba(0, 0, 0, .34);
    --shadow-lg:      0 26px 60px rgba(0, 0, 0, .45);
    --glow:           0 0 30px rgba(14, 165, 233, .30);
    --glow-accent:    0 0 30px rgba(244, 63, 94, .28);

    /* الخطوط */
    --font:           'Tajawal', 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-en:        'Cairo', 'Segoe UI', system-ui, sans-serif;

    /* الحركة */
    --ease:           cubic-bezier(.34, 1.56, .64, 1);
    --ease-out:       cubic-bezier(.16, 1, .3, 1);
    --dur:            .35s;

    /* أبعاد */
    --sidebar-w:      260px;
    --content-max:    1400px;

    /* ---------------------------------------------------------------
       أسماء بديلة (Legacy aliases) — للصفحات اللي بتستخدم الأسماء القديمة
       --------------------------------------------------------------- */
    --text-light:      var(--text);
    --text-secondary:  var(--text-muted);
    --light:           var(--text);
    --dark:            var(--bg-2);
    --card-bg:         var(--surface);
    --sidebar-bg:      var(--surface);
    --primary-button:  var(--primary);
    --secondary-button:var(--secondary);
    --danger-button:   var(--error);
    --warning-button:  var(--warning);
    --info-alert:      var(--info);
    --info:            var(--info);
    --info-icon:       var(--info);
    --success-icon:    var(--success);
    --warning-icon:    var(--warning);
    --glass:           rgba(255, 255, 255, .1);
    --transition:      all .35s var(--ease);
    --bg-color:        var(--bg-1);
    --sidebar-width:   var(--sidebar-w);
}

/* --------------------------------------------------------------------------
   2. الأساسيات (Reset & Base)
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: linear-gradient(135deg, var(--grad-1), var(--grad-2), var(--grad-3));
    background-size: 400% 400%;
    animation: themeGradient 18s ease infinite;
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    line-height: 1.35;
    color: var(--text);
    letter-spacing: -.2px;
}

h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }

p { color: var(--text-soft); }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--dur) ease;
}
a:hover { color: var(--secondary); }

img { max-width: 100%; display: block; }

hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
    margin: 18px 0;
}

::selection {
    background: var(--primary);
    color: var(--on-primary);
}

/* شريط التمرير */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary), var(--primary-dark));
    border-radius: var(--radius-pill);
    border: 2px solid var(--bg-1);
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* --------------------------------------------------------------------------
   3. التخطيط (Layout)
   -------------------------------------------------------------------------- */
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex-grow: 1;
    min-width: 0;
    padding: 30px;
    position: relative;
    z-index: 1;
}

/* ✅ إصلاح التمدد الأفقي: الجداول العريضة ما بتدفع المحتوى بره الشاشة */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.container {
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding-bottom: 18px;
    margin-bottom: 26px;
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(90deg, #fff, var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}
.section-title i { color: var(--primary); }

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
    gap: 0;
}
.row > * { padding: 0 12px; }

/* --------------------------------------------------------------------------
   4. البطاقات (Cards)
   -------------------------------------------------------------------------- */
.card {
    background: var(--surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) ease, border-color var(--dur) ease;
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    opacity: .85;
}

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

.stat-box {
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) ease;
}
.stat-box:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.stat-box .number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}
.stat-box .label {
    font-size: .92rem;
    color: var(--text-muted);
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 3rem;
    color: var(--primary);
    opacity: .5;
    margin-bottom: 14px;
    display: block;
}
.empty-state p { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   5. الأزرار (Buttons)
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) ease, background var(--dur) ease, border-color var(--dur) ease;
    white-space: nowrap;
}
.btn:hover {
    transform: translateY(-2px);
    background: var(--surface-3);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 22px var(--primary-glow);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: #fff;
    box-shadow: 0 12px 30px var(--primary-glow);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--primary-dark));
    border-color: transparent;
    color: #04121f;
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #15803d);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 22px rgba(34, 197, 94, .28);
}
.btn-warning {
    background: linear-gradient(135deg, var(--warning), #b45309);
    border-color: transparent;
    color: #1c1206;
}
.btn-danger {
    background: linear-gradient(135deg, var(--error), var(--pink));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 22px var(--pink-glow);
}
.btn-info {
    background: linear-gradient(135deg, var(--info), var(--primary-dark));
    border-color: transparent;
    color: #fff;
}
.btn-outline {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background: var(--primary-soft); color: var(--secondary); }

.btn-sm { padding: 7px 14px; font-size: .85rem; border-radius: var(--radius-xs); }
.btn-lg { padding: 15px 32px; font-size: 1.05rem; border-radius: var(--radius); }
.btn-block { width: 100%; }

/* --------------------------------------------------------------------------
   6. النماذج (Forms)
   -------------------------------------------------------------------------- */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: .93rem;
    color: var(--text-soft);
}

.form-control,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="month"],
.form-group input[type="search"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea,
input.form-control,
select.form-control,
textarea.form-control {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: .97rem;
    transition: border-color var(--dur) ease, box-shadow var(--dur) ease, background var(--dur) ease;
}

.form-control:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, .08);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-control::placeholder,
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-dim); }

.form-group select option {
    background: var(--bg-2);
    color: var(--text);
}

/* --------------------------------------------------------------------------
   7. الجداول (Tables)
   -------------------------------------------------------------------------- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .93rem;
}

table thead th {
    background: var(--surface-2);
    color: var(--text);
    font-weight: 700;
    text-align: right;
    padding: 13px 15px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-strong);
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    z-index: 2;
}

table tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    color: var(--text-soft);
    vertical-align: middle;
}

table tbody tr { transition: background var(--dur) ease; }
table tbody tr:hover { background: var(--surface); }
table tbody tr:last-child td { border-bottom: 0; }

/* --------------------------------------------------------------------------
   8. الشارات (Badges)
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: var(--radius-pill);
    font-size: .78rem;
    font-weight: 700;
    background: var(--surface-2);
    color: var(--text-soft);
    border: 1px solid var(--border);
    white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: #4ade80; border-color: rgba(34, 197, 94, .35); }
.badge-warning { background: var(--warning-soft); color: #fbbf24; border-color: rgba(245, 158, 11, .35); }
.badge-danger,
.badge-error   { background: var(--error-soft); color: #fca5a5; border-color: rgba(239, 68, 68, .35); }
.badge-info    { background: var(--info-soft); color: #7dd3fc; border-color: rgba(56, 189, 248, .35); }
.badge-primary { background: var(--primary-soft); color: #7dd3fc; border-color: rgba(14, 165, 233, .35); }
.badge-active  { background: var(--success-soft); color: #4ade80; border-color: rgba(34, 197, 94, .35); }
.badge-inactive{ background: var(--error-soft); color: #fca5a5; border-color: rgba(239, 68, 68, .35); }

/* --------------------------------------------------------------------------
   9. التنبيهات (Alerts)
   -------------------------------------------------------------------------- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}
.alert-success { background: var(--success-soft); color: #86efac; border-color: rgba(34, 197, 94, .35); }
.alert-danger,
.alert-error   { background: var(--error-soft); color: #fca5a5; border-color: rgba(239, 68, 68, .35); }
.alert-warning { background: var(--warning-soft); color: #fcd34d; border-color: rgba(245, 158, 11, .35); }
.alert-info    { background: var(--info-soft); color: #7dd3fc; border-color: rgba(56, 189, 248, .35); }

/* --------------------------------------------------------------------------
   10. السايد بار (Sidebar)
   -------------------------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--grad-1), var(--grad-2));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid var(--border);
    box-shadow: -6px 0 22px rgba(0, 0, 0, .32);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: transform .35s var(--ease-out);
}

.sidebar-header {
    text-align: center;
    font-size: 1.32rem;
    font-weight: 800;
    padding: 22px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    color: #fff;
}
.sidebar-header i { color: var(--primary); }
.sidebar-header span {
    background: linear-gradient(90deg, #fff, var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
    overflow-y: auto;
}

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

.menu-link {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 15px;
    color: var(--text-soft);
    text-decoration: none;
    font-size: .97rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border-right: 3px solid transparent;
    transition: all var(--dur) ease;
}
.menu-link:hover {
    background: var(--surface);
    color: var(--secondary);
    transform: translateX(-4px);
}
.menu-link i {
    font-size: 1.15rem;
    width: 26px;
    text-align: center;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: color var(--dur) ease;
}
.menu-link:hover i { color: var(--primary); }
.menu-item.active .menu-link {
    background: var(--primary-soft);
    color: var(--secondary);
    border-right-color: var(--primary);
}
.menu-item.active .menu-link i { color: var(--primary); }
.menu-item.logout .menu-link { background: var(--error-soft); color: #fca5a5; margin-top: 26px; }
.menu-item.logout .menu-link:hover { background: var(--error); color: #fff; }

/* --------------------------------------------------------------------------
   11. عناصر مشتركة
   -------------------------------------------------------------------------- */
.info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: 0; }
.info-row .label { color: var(--text-muted); font-weight: 600; min-width: 130px; }
.info-row .value { color: var(--text); font-weight: 700; }

.report-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 9px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    box-shadow: var(--glow);
}
.avatar-lg { width: 120px; height: 120px; }
.avatar-xl { width: 170px; height: 170px; border-width: 4px; }

.icon-box {
    width: 58px;
    height: 58px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-soft), var(--secondary-soft));
    color: var(--primary);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
    margin: 26px 0;
}

/* --------------------------------------------------------------------------
   12. الحركات (Animations)
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(26px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-16px); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.06); }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}
@keyframes typing-blink {
    50% { border-right-color: var(--primary); }
}

.animate-fade   { animation: fadeIn .6s var(--ease-out) both; }
.animate-fade-up{ animation: fadeUp .7s var(--ease-out) both; }
.animate-float  { animation: float 6s ease-in-out infinite; }
.animate-pulse  { animation: pulse 2.4s ease-in-out infinite; }

.delay-1 { animation-delay: .08s; }
.delay-2 { animation-delay: .16s; }
.delay-3 { animation-delay: .24s; }
.delay-4 { animation-delay: .32s; }

/* --------------------------------------------------------------------------
   13. الاستجابة (Responsive)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .main-content { padding: 22px; }
    .page-title { font-size: 1.7rem; }
}

@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .main-content { padding: 16px; padding-top: 74px; }
    .content-header { flex-direction: column; align-items: flex-start; gap: 14px; }
    .content-header .header-buttons { width: 100%; }
    .page-title { font-size: 1.5rem; }
    .card { padding: 16px; }
    .row { flex-direction: column; }
    .row > * { width: 100%; }
    table { font-size: .86rem; }
    table thead th, table tbody td { padding: 10px 11px; }
}

@media (max-width: 480px) {
    .main-content { padding: 12px; padding-top: 66px; }
    .card { padding: 14px; border-radius: var(--radius-sm); }
    .page-title { font-size: 1.3rem; }
    .btn { padding: 10px 15px; font-size: .88rem; }
    .stat-box { padding: 15px; }
    .stat-box .number { font-size: 1.7rem; }
}

/* --------------------------------------------------------------------------
   14. السايد بار — الإضافات (زر القائمة + Overlay + الموبايل)
   -------------------------------------------------------------------------- */
.sidebar-toggle-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    cursor: pointer;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 6px 20px var(--primary-glow);
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) ease;
}
.sidebar-toggle-btn:hover {
    transform: scale(1.07);
    box-shadow: 0 10px 28px var(--primary-glow);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(3px);
    z-index: 999;
}

.sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, .7);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 5px 10px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}
.sidebar-close:hover { color: #fff; }

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        right: -300px;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        box-shadow: -5px 0 25px rgba(0, 0, 0, .45);
        transition: right .35s var(--ease-out);
    }
    .sidebar.open { right: 0; }
    .sidebar-overlay.show { display: block; }
    .sidebar-toggle-btn { display: flex; top: 18px; left: 18px; width: 44px; height: 44px; font-size: 1.4rem; }
    .sidebar-close { display: block; right: 10px; }
    .main-content { padding-top: 74px !important; }
}

@media (max-width: 480px) {
    .sidebar { width: 260px; right: -270px; }
    .sidebar-toggle-btn { width: 40px; height: 40px; font-size: 1.2rem; top: 14px; left: 14px; }
    .main-content { padding-top: 66px !important; }
}

/* --------------------------------------------------------------------------
   15. شبكة الأعمدة (Bootstrap-like) + مساعدات
   -------------------------------------------------------------------------- */
.container-fluid { width: 100%; padding: 0 15px; }
.col-md-3 { flex: 0 0 25%; max-width: 25%; padding: 0 15px; }
.col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 15px; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; padding: 0 15px; }
.col-12    { flex: 0 0 100%; max-width: 100%; padding: 0 15px; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mt-3 { margin-top: 1rem !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--error) !important; }
.text-warning { color: var(--warning) !important; }
.text-primary { color: var(--primary) !important; }
.d-flex { display: flex !important; }
.d-none { display: none !important; }
.gap-2 { gap: .5rem !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }
.w-100 { width: 100% !important; }

@media (max-width: 768px) {
    .col-md-3, .col-md-4, .col-md-6 { flex: 0 0 100%; max-width: 100%; padding: 0 10px; }
    .col-md-3.mb-4 { margin-bottom: 1rem !important; }
}

/* --------------------------------------------------------------------------
   17. صفحات الطباعة (Print pages) — خلفية فاتحة + روابط theme.css
   -------------------------------------------------------------------------- */
body.print-page {
    background: #f1f5f9 !important;
    background-image: none !important;
    animation: none !important;
    color: #1e293b;
}
body.print-page .card,
body.print-page .report-container {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .08) !important;
    color: #1e293b;
}
body.print-page h1,
body.print-page h2,
body.print-page h3,
body.print-page .page-title,
body.print-page .report-container h2 { color: #0c1222 !important; }
body.print-page p,
body.print-page .label,
body.print-page td,
body.print-page th { color: #334155 !important; }
body.print-page table thead th {
    background: #e2e8f0 !important;
    color: #0c1222 !important;
    border-bottom: 1px solid #94a3b8 !important;
}
body.print-page table tbody td { border-bottom: 1px solid #e2e8f0 !important; }

/* --------------------------------------------------------------------------
   18. الطباعة (Print)
   -------------------------------------------------------------------------- */
@media print {
    body { background: #fff !important; color: #000 !important; animation: none !important; }
    .sidebar, .btn, .no-print, .header-buttons { display: none !important; }
    .card, table thead th, table tbody td { background: #fff !important; color: #000 !important; box-shadow: none !important; }
    .report-container { box-shadow: none !important; border: 1px solid #ccc; }
}
