/* ===== Smart Clinic — نظام التصميم (Cairo + وضع ليلي + RTL/LTR) ===== */

/* ---- الخط العربي Cairo (مستضاف محليًّا) ---- */
@font-face { font-family: 'Cairo'; font-weight: 400; font-display: swap;
    src: url('/fonts/cairo/cairo-400-arabic.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Cairo'; font-weight: 400; font-display: swap;
    src: url('/fonts/cairo/cairo-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Cairo'; font-weight: 500; font-display: swap;
    src: url('/fonts/cairo/cairo-500-arabic.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Cairo'; font-weight: 500; font-display: swap;
    src: url('/fonts/cairo/cairo-500-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Cairo'; font-weight: 600; font-display: swap;
    src: url('/fonts/cairo/cairo-600-arabic.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Cairo'; font-weight: 600; font-display: swap;
    src: url('/fonts/cairo/cairo-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Cairo'; font-weight: 700; font-display: swap;
    src: url('/fonts/cairo/cairo-700-arabic.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Cairo'; font-weight: 700; font-display: swap;
    src: url('/fonts/cairo/cairo-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }

/* ---- الرموز (Design Tokens) — الوضع الفاتح ---- */
:root {
    --sc-sidebar-width: 258px;
    --sc-topbar-height: 60px;
    --sc-primary: #0e7490;
    --sc-primary-rgb: 14, 116, 144;
    --sc-primary-hover: #0b5f76;
    --sc-radius: .85rem;
    --sc-radius-sm: .55rem;

    /* أسطح ونصوص */
    --sc-page-bg: #eef2f7;
    --sc-surface: #ffffff;
    --sc-surface-2: #f7f9fc;
    --sc-border: #e4e9f0;
    --sc-border-strong: #d3dbe6;
    --sc-text: #17222f;
    --sc-text-muted: #5f7183;
    --sc-text-faint: #93a1b3;

    /* الشريط الجانبي */
    --sc-sidebar-bg: #0f2c47;
    --sc-sidebar-bg2: #0c243a;
    --sc-sidebar-text: #b8cbe0;
    --sc-sidebar-hover: rgba(255,255,255,.07);
    --sc-sidebar-active: rgba(56,189,248,.14);
    --sc-sidebar-accent: #38bdf8;

    --sc-shadow-sm: 0 1px 2px rgba(16,48,77,.06), 0 1px 3px rgba(16,48,77,.05);
    --sc-shadow: 0 2px 8px rgba(16,48,77,.07), 0 1px 3px rgba(16,48,77,.05);
    --sc-shadow-lg: 0 12px 34px rgba(16,48,77,.16);
    --sc-transition: .18s cubic-bezier(.4,0,.2,1);
    color-scheme: light;
}

/* ---- الوضع الليلي ---- */
:root[data-theme="dark"] {
    --sc-page-bg: #0d1620;
    --sc-surface: #16222f;
    --sc-surface-2: #1c2a39;
    --sc-border: #253444;
    --sc-border-strong: #33475a;
    --sc-text: #e6edf5;
    --sc-text-muted: #93a6ba;
    --sc-text-faint: #6b7f93;
    --sc-primary: #22a5c4;
    --sc-primary-rgb: 34, 165, 196;
    --sc-primary-hover: #35b7d6;
    --sc-sidebar-bg: #0a141e;
    --sc-sidebar-bg2: #07101a;
    --sc-sidebar-text: #9fb3c8;
    --sc-shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --sc-shadow: 0 2px 10px rgba(0,0,0,.35);
    --sc-shadow-lg: 0 14px 38px rgba(0,0,0,.5);
    color-scheme: dark;
}

* { -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body, .app-body {
    background: var(--sc-page-bg);
    color: var(--sc-text);
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: .94rem;
    transition: background var(--sc-transition), color var(--sc-transition);
}

/* توحيد ألوان Bootstrap مع الثيم */
.card, .modal-content, .dropdown-menu, .list-group-item, .offcanvas {
    background-color: var(--sc-surface); color: var(--sc-text);
    border-color: var(--sc-border);
}
.text-muted { color: var(--sc-text-muted) !important; }
.border, .border-top, .border-bottom, .border-start, .border-end { border-color: var(--sc-border) !important; }
hr { border-color: var(--sc-border); opacity: 1; }
a { color: var(--sc-primary); }
a:hover { color: var(--sc-primary-hover); }
.btn-primary { --bs-btn-bg: var(--sc-primary); --bs-btn-border-color: var(--sc-primary);
    --bs-btn-hover-bg: var(--sc-primary-hover); --bs-btn-hover-border-color: var(--sc-primary-hover);
    --bs-btn-active-bg: var(--sc-primary-hover); --bs-btn-disabled-bg: var(--sc-primary); }
.btn-outline-primary { --bs-btn-color: var(--sc-primary); --bs-btn-border-color: var(--sc-primary);
    --bs-btn-hover-bg: var(--sc-primary); --bs-btn-hover-border-color: var(--sc-primary); }
.text-primary { color: var(--sc-primary) !important; }
.form-control, .form-select {
    background-color: var(--sc-surface); color: var(--sc-text); border-color: var(--sc-border-strong);
    transition: border-color var(--sc-transition), box-shadow var(--sc-transition);
}
.form-control:focus, .form-select:focus {
    background-color: var(--sc-surface); color: var(--sc-text); border-color: var(--sc-primary);
    box-shadow: 0 0 0 .2rem rgba(var(--sc-primary-rgb), .18);
}
.form-control::placeholder { color: var(--sc-text-faint); }
.table { --bs-table-bg: transparent; --bs-table-color: var(--sc-text);
    --bs-table-border-color: var(--sc-border); }
.table > :not(caption) > * > * { background-color: transparent; color: var(--sc-text); }
.table-hover > tbody > tr:hover > * { background-color: var(--sc-surface-2); }
.table-light, .table thead.table-light th { --bs-table-bg: var(--sc-surface-2); color: var(--sc-text-muted); }
.dropdown-item { color: var(--sc-text); }
.dropdown-item:hover { background-color: var(--sc-surface-2); color: var(--sc-text); }
.modal-header, .modal-footer { border-color: var(--sc-border); }
.page-link { background: var(--sc-surface); border-color: var(--sc-border); color: var(--sc-primary); }
.page-item.active .page-link { background: var(--sc-primary); border-color: var(--sc-primary); }
.page-item.disabled .page-link { background: var(--sc-surface); border-color: var(--sc-border); color: var(--sc-text-faint); }
.breadcrumb { color: var(--sc-text-muted); }
.nav-tabs { border-color: var(--sc-border); }
.nav-tabs .nav-link { color: var(--sc-text-muted); }
.nav-tabs .nav-link.active { background: var(--sc-surface); color: var(--sc-primary);
    border-color: var(--sc-border) var(--sc-border) var(--sc-surface); }

/* ---- الوضع الليلي: رموز Bootstrap الدلالية عالية التباين (WCAG AA على الأسطح الداكنة) ---- */
:root[data-theme="dark"] {
    /* رموز التأكيد الدلالية الداكنة (تُستعمَل مع bg-*-subtle) */
    --bs-success-text-emphasis: #4ade80;
    --bs-danger-text-emphasis: #f87171;
    --bs-warning-text-emphasis: #fbbf24;
    --bs-info-text-emphasis: #38bdf8;
    --bs-primary-text-emphasis: #4cc4e0;
    --bs-secondary-text-emphasis: #aab8c7;
}
/* رموز اللون الدلالية النصية الصريحة (Bootstrap يبقيها فاتحة الأصل ↦ تباين منخفض ليلًا) */
:root[data-theme="dark"] .text-success { color: #4ade80 !important; }
:root[data-theme="dark"] .text-danger  { color: #f87171 !important; }
:root[data-theme="dark"] .text-warning { color: #fbbf24 !important; }
:root[data-theme="dark"] .text-info    { color: #38bdf8 !important; }
:root[data-theme="dark"] .text-secondary { color: var(--sc-text-muted) !important; }
/* شارات bg-light text-dark ↦ رقاقات داكنة متّسقة بدل الأبيض الوهّاج */
:root[data-theme="dark"] .text-dark { color: var(--sc-text) !important; }
:root[data-theme="dark"] .bg-light { background-color: var(--sc-surface-2) !important; }

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

/* ---- الشريط الجانبي ---- */
.sidebar {
    width: var(--sc-sidebar-width);
    background: linear-gradient(180deg, var(--sc-sidebar-bg) 0%, var(--sc-sidebar-bg2) 100%);
    color: var(--sc-sidebar-text);
    flex-shrink: 0; display: flex; flex-direction: column;
    transition: margin-inline-start .25s cubic-bezier(.4,0,.2,1);
    box-shadow: var(--sc-shadow);
}
.sidebar.collapsed { margin-inline-start: calc(-1 * var(--sc-sidebar-width)); }
.sidebar-brand {
    display: flex; align-items: center; gap: .65rem;
    font-size: 1.1rem; font-weight: 700; color: #fff;
    padding: 0 1.15rem; height: var(--sc-topbar-height); flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .brand-mark {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--sc-primary) 0%, #38bdf8 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.15rem; box-shadow: 0 3px 10px rgba(56,189,248,.35);
}
.sidebar-brand .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.sidebar-brand .brand-text small { font-size: .62rem; font-weight: 400; color: var(--sc-sidebar-accent); letter-spacing: .3px; }
.sidebar-nav { list-style: none; margin: 0; padding: .6rem .55rem; overflow-y: auto; flex: 1; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
.sidebar-nav li a {
    display: flex; align-items: center; gap: .7rem;
    color: var(--sc-sidebar-text); text-decoration: none;
    padding: .55rem .8rem; margin-bottom: 2px; font-size: .9rem; font-weight: 500;
    border-radius: var(--sc-radius-sm); position: relative;
    transition: background var(--sc-transition), color var(--sc-transition), transform var(--sc-transition);
}
.sidebar-nav li a:hover { background: var(--sc-sidebar-hover); color: #fff; }
.sidebar-nav li a.active {
    background: var(--sc-sidebar-active); color: #fff;
}
.sidebar-nav li a.active::before {
    content: ''; position: absolute; inset-inline-start: 0; top: 20%; bottom: 20%;
    width: 3px; border-radius: 3px; background: var(--sc-sidebar-accent);
}
.sidebar-nav li a i { font-size: 1.05rem; width: 1.3rem; text-align: center; flex-shrink: 0; }
.sidebar-divider { border-top: 1px solid rgba(255,255,255,.08); margin: .55rem .3rem; }

/* ---- الشريط العلوي ---- */
.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: var(--sc-topbar-height);
    background: var(--sc-surface); border-bottom: 1px solid var(--sc-border);
    display: flex; align-items: center; padding: 0 1.1rem; gap: .5rem;
    position: sticky; top: 0; z-index: 100; box-shadow: var(--sc-shadow-sm);
}
.topbar-toggle { color: var(--sc-text-muted); border: none; background: none; padding: .3rem .5rem; border-radius: var(--sc-radius-sm); }
.topbar-toggle:hover { background: var(--sc-surface-2); color: var(--sc-text); }
.topbar .btn-icon {
    width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 1px solid var(--sc-border); background: var(--sc-surface);
    color: var(--sc-text-muted); transition: all var(--sc-transition); position: relative;
}
.topbar .btn-icon:hover { background: var(--sc-surface-2); color: var(--sc-primary); border-color: var(--sc-border-strong); }
.topbar .btn-icon .badge-dot {
    position: absolute; top: 4px; inset-inline-end: 6px; min-width: 16px; height: 16px; padding: 0 4px;
    font-size: .62rem; line-height: 16px; text-align: center; border-radius: 8px;
    background: #ef4444; color: #fff; font-weight: 600;
}

/* ---- المحتوى ---- */
.app-content { padding: 1.4rem; flex: 1; max-width: 1600px; width: 100%; margin: 0 auto; }
.page-header { margin-bottom: 1.25rem; }
.page-header h1 { font-size: 1.35rem; font-weight: 700; margin: 0; color: var(--sc-text); }

/* ---- البطاقات الإحصائية ---- */
.stat-card {
    border: 1px solid var(--sc-border); border-radius: var(--sc-radius);
    background: var(--sc-surface); box-shadow: var(--sc-shadow-sm);
    transition: transform var(--sc-transition), box-shadow var(--sc-transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--sc-shadow); }
.stat-card .stat-icon {
    width: 50px; height: 50px; border-radius: var(--sc-radius-sm);
    display: flex; align-items: center; justify-content: center; font-size: 1.45rem; flex-shrink: 0;
}
.stat-card .fw-bold { color: var(--sc-text); }

/* ---- بطاقات المحتوى والجداول ---- */
.card { border: 1px solid var(--sc-border); border-radius: var(--sc-radius); box-shadow: var(--sc-shadow-sm); }
.table-card {
    background: var(--sc-surface); border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius); box-shadow: var(--sc-shadow-sm); padding: 1.15rem;
}
.table thead th { font-size: .82rem; font-weight: 600; color: var(--sc-text-muted); white-space: nowrap; border-bottom-color: var(--sc-border-strong); }
.table td, .table th { vertical-align: middle; }

/* ---- الحالات الفارغة ---- */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--sc-text-muted); }
.empty-state .empty-icon {
    width: 76px; height: 76px; margin: 0 auto 1rem; border-radius: 50%;
    background: rgba(var(--sc-primary-rgb), .09); color: var(--sc-primary);
    display: flex; align-items: center; justify-content: center; font-size: 2.1rem;
}
.empty-state h3 { font-size: 1.05rem; font-weight: 600; color: var(--sc-text); margin-bottom: .35rem; }
.empty-state p { font-size: .88rem; margin-bottom: 1rem; max-width: 380px; margin-inline: auto; }

/* ---- صفحة تسجيل الدخول ---- */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem;
    background: radial-gradient(circle at 20% 20%, #164863 0%, #0f2c47 45%, #0a1f33 100%);
    position: relative; overflow: hidden;
}
.login-page::before, .login-page::after {
    content: ''; position: absolute; border-radius: 50%; opacity: .12;
    background: radial-gradient(circle, #38bdf8 0%, transparent 70%);
}
.login-page::before { width: 480px; height: 480px; top: -140px; inset-inline-end: -120px; }
.login-page::after { width: 380px; height: 380px; bottom: -120px; inset-inline-start: -100px; }
.login-card {
    width: 100%; max-width: 425px; position: relative; z-index: 1;
    background: var(--sc-surface); border-radius: 1.15rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.35); padding: 2.4rem 2.2rem;
    animation: sc-rise .5s cubic-bezier(.4,0,.2,1);
}
.login-logo {
    width: 66px; height: 66px; margin: 0 auto; border-radius: 20px;
    background: linear-gradient(135deg, var(--sc-primary) 0%, #38bdf8 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 2rem; box-shadow: 0 8px 24px rgba(56,189,248,.4);
}

/* ---- رابط التخطّي إلى المحتوى (يظهر بالتركيز فقط — WCAG 2.4.1) ---- */
.skip-link {
    position: fixed; inset-inline-start: 1rem; top: -80px; z-index: 2000;
    background: var(--sc-primary); color: #fff; padding: .55rem 1rem;
    border-radius: var(--sc-radius-sm); font-weight: 600; text-decoration: none;
    box-shadow: var(--sc-shadow-lg); transition: top var(--sc-transition);
}
.skip-link:focus { top: 1rem; color: #fff; outline: 2px solid #fff; outline-offset: 2px; }
#mainContent:focus { outline: none; }

/* ---- حركات دقيقة ---- */
@keyframes sc-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes sc-fade { from { opacity: 0; } to { opacity: 1; } }
.app-content > * { animation: sc-fade .3s ease; }
.btn { transition: transform var(--sc-transition), background-color var(--sc-transition), box-shadow var(--sc-transition); }
.btn:active { transform: scale(.97); }
.alert { border: none; border-radius: var(--sc-radius-sm); box-shadow: var(--sc-shadow-sm); animation: sc-rise .3s ease; }
.badge { font-weight: 500; }
.list-group-item-action { transition: background-color var(--sc-transition); }
.modal.fade .modal-dialog { transition: transform .2s ease-out, opacity .2s; }

/* هيكل تحميل عظمي */
.sc-skeleton {
    background: linear-gradient(90deg, var(--sc-surface-2) 25%, var(--sc-border) 37%, var(--sc-surface-2) 63%);
    background-size: 400% 100%; animation: sc-shimmer 1.3s ease infinite; border-radius: var(--sc-radius-sm);
}
@keyframes sc-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---- استجابة الموبايل ---- */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(8,20,32,.5); z-index: 1035; }
@media (max-width: 991.98px) {
    .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 1040; margin-inline-start: calc(-1 * var(--sc-sidebar-width)); }
    .sidebar.show { margin-inline-start: 0; }
    .sidebar-backdrop.show { display: block; }
    .app-content { padding: 1rem; }
}

/* ---- لوحة الأوامر Ctrl+K ---- */
#scCommandPalette .modal-content { border-radius: var(--sc-radius); overflow: hidden; border: 1px solid var(--sc-border); }
.sc-cmd-head { display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; border-bottom: 1px solid var(--sc-border); }
.sc-cmd-head i { color: var(--sc-text-muted); font-size: 1.1rem; }
.sc-cmd-input { border: none; outline: none; background: transparent; color: var(--sc-text); font-size: 1rem; width: 100%; font-family: inherit; }
.sc-cmd-kbd { font-size: .68rem; color: var(--sc-text-faint); border: 1px solid var(--sc-border); border-radius: 6px; padding: .1rem .4rem; }
.sc-cmd-list { max-height: 380px; overflow-y: auto; padding: .4rem; }
.sc-cmd-item { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: var(--sc-radius-sm); color: var(--sc-text); text-decoration: none; }
.sc-cmd-item i { width: 1.2rem; text-align: center; color: var(--sc-text-muted); }
.sc-cmd-item.active { background: var(--sc-primary); color: #fff; }
.sc-cmd-item.active i { color: #fff; }
.sc-cmd-label { flex: 1; font-size: .9rem; }
.sc-cmd-group { font-size: .72rem; color: var(--sc-text-faint); }
.sc-cmd-item.active .sc-cmd-group { color: rgba(255,255,255,.75); }

/* ---- زر الإملاء الصوتي ---- */
.sc-voice-wrap { position: relative; display: block; }
.sc-voice-btn { position: absolute; inset-block-start: 6px; inset-inline-end: 6px; z-index: 3;
    width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--sc-border);
    background: var(--sc-surface); color: var(--sc-text-muted); display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all var(--sc-transition); }
.sc-voice-btn:hover:not(:disabled) { color: var(--sc-primary); border-color: var(--sc-primary); }
.sc-voice-btn:disabled { opacity: .4; cursor: not-allowed; }
.sc-voice-btn.rec { background: #ef4444; color: #fff; border-color: #ef4444; animation: sc-pulse 1.1s infinite; }
.sc-voice-wrap textarea[data-voice] { padding-inline-end: 42px; }
@keyframes sc-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); } 50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); } }

/* ---- نجمة تثبيت القائمة + المفضّلة ---- */
.sidebar-nav li a { position: relative; }
.sc-pin { position: absolute; inset-inline-end: .5rem; top: 50%; transform: translateY(-50%);
    opacity: 0; color: var(--sc-sidebar-text); font-size: .8rem; padding: .2rem; border-radius: 5px; transition: opacity var(--sc-transition); }
.sidebar-nav li a:hover .sc-pin { opacity: .7; }
.sc-pin:hover { opacity: 1 !important; color: var(--sc-sidebar-accent); }
.sc-pin.pinned { opacity: 1; color: #fbbf24; }
.sc-pin.pinned i::before { content: "\f588"; } /* bi-star-fill */
#scFavNav { margin-bottom: .4rem; padding-bottom: .4rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-fav-head { color: #6f89a6; font-size: .66rem; font-weight: 600; padding: .5rem .8rem .3rem; }
.sc-fav-link { display: flex; align-items: center; gap: .7rem; color: var(--sc-sidebar-text); text-decoration: none;
    padding: .5rem .8rem; margin: 0 .05rem 2px; border-radius: var(--sc-radius-sm); font-size: .88rem; font-weight: 500; }
.sc-fav-link:hover { background: var(--sc-sidebar-hover); color: #fff; }
.sc-fav-link.active { background: var(--sc-sidebar-active); color: #fff; }
.sc-fav-link i { width: 1.3rem; text-align: center; }

/* ---- الدليل السريع للصفحة ---- */
.sc-guide-body h6 { color: var(--sc-primary); font-weight: 700; font-size: .9rem; margin: 1rem 0 .3rem; }
.sc-guide-body h6:first-child { margin-top: 0; }
.sc-guide-body ul { padding-inline-start: 1.2rem; margin-bottom: .5rem; }
.sc-guide-body li { font-size: .9rem; margin-bottom: .2rem; }
.sc-guide-tip { background: rgba(var(--sc-primary-rgb), .08); border-radius: var(--sc-radius-sm); padding: .7rem .9rem; font-size: .88rem; }
.sc-guide-roles .badge { margin-inline-end: .3rem; }

/* ---- تقليل الحركة (WCAG 2.3.3 / احترام تفضيل النظام) ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
    .sc-skeleton { animation: none !important; }
    .sc-voice-btn.rec { animation: none !important; }
    .app-content > * { animation: none !important; }
}

/* ---- الطباعة ---- */
@media print {
    .sidebar, .topbar, .sidebar-backdrop { display: none !important; }
    .app-content { padding: 0; max-width: none; }
    body, .app-body { background: #fff; }
}
