/* =====================================================================
   تمام — الحركة والروح (v1.66): دخول ناعم للمحتوى، تفاعلات هادية، شريط تحميل، عدّاد أرقام.
   كله بيحترم «تقليل الحركة» من إعدادات الجهاز.
   ===================================================================== */

/* ---------- لوجو الموديول: تمام + اسم الموديول بلونه (بيتبدّل في الدارك) ---------- */
.mod-brand { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: inherit; line-height: 1; }
.mod-brand__logo { display: inline-flex; background: none !important; padding: 0 !important; }
.mod-brand__logo img { display: block; height: 24px; width: auto; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.mod-brand__logo .logo-dark { display: none; }
html[data-theme="dark"] .mod-brand__logo .logo-light { display: none; }
html[data-theme="dark"] .mod-brand__logo .logo-dark { display: block; }
.mod-brand:hover .mod-brand__logo img { transform: rotate(-6deg) scale(1.06); }
.mod-brand__name { font-size: 13px; font-weight: 650; letter-spacing: 0; color: #fff !important; background: var(--mod, #475569) !important; padding: 4px 11px; border-radius: 8px; box-shadow: 0 1px 0 rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .18); }

/* ---------- الحركات ---------- */
@keyframes pl-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pl-pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes pl-slide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes pl-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes pl-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); } 50% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); } }

.content > *, .pt-frame > *, .co-pick__in > *, .auth2__form > * { animation: pl-rise .45s cubic-bezier(.2, .7, .2, 1) both; }
.content > *:nth-child(2), .pt-frame > *:nth-child(2) { animation-delay: .05s; }
.content > *:nth-child(3), .pt-frame > *:nth-child(3) { animation-delay: .1s; }
.content > *:nth-child(4), .pt-frame > *:nth-child(4) { animation-delay: .15s; }
.content > *:nth-child(5), .pt-frame > *:nth-child(5) { animation-delay: .2s; }
.content > *:nth-child(n+6), .pt-frame > *:nth-child(n+6) { animation-delay: .25s; }

/* كروت/مربعات: ظهور متتابع */
.grid > *, .co-grid > *, .apps-grid > *, .pt-tiles > *, .pt-cols > *, .tpl-grid > *, .sl-strip > div { animation: pl-rise .5s cubic-bezier(.2, .7, .2, 1) both; }
.grid > *:nth-child(2), .co-grid > *:nth-child(2), .apps-grid > *:nth-child(2), .pt-tiles > *:nth-child(2), .pt-cols > *:nth-child(2), .sl-strip > div:nth-child(2) { animation-delay: .06s; }
.grid > *:nth-child(3), .co-grid > *:nth-child(3), .apps-grid > *:nth-child(3), .pt-tiles > *:nth-child(3), .pt-cols > *:nth-child(3), .sl-strip > div:nth-child(3) { animation-delay: .12s; }
.grid > *:nth-child(4), .co-grid > *:nth-child(4), .apps-grid > *:nth-child(4), .pt-tiles > *:nth-child(4), .sl-strip > div:nth-child(4) { animation-delay: .18s; }
.grid > *:nth-child(n+5), .co-grid > *:nth-child(n+5), .apps-grid > *:nth-child(n+5), .pt-tiles > *:nth-child(n+5) { animation-delay: .24s; }

/* صفوف القوائم */
.sl-rows > *, .table tbody tr, .feed__item, .notif, .tk { animation: pl-fade .4s ease both; }
.sl-rows > *:nth-child(2), .table tbody tr:nth-child(2) { animation-delay: .03s; }
.sl-rows > *:nth-child(3), .table tbody tr:nth-child(3) { animation-delay: .06s; }
.sl-rows > *:nth-child(4), .table tbody tr:nth-child(4) { animation-delay: .09s; }
.sl-rows > *:nth-child(5), .table tbody tr:nth-child(5) { animation-delay: .12s; }
.sl-rows > *:nth-child(6), .table tbody tr:nth-child(6) { animation-delay: .15s; }
.sl-rows > *:nth-child(n+7), .table tbody tr:nth-child(n+7) { animation-delay: .18s; }

/* تفاعلات */
.card, .stat, .tile, .app-card, .co-card, .tpl-card, .pt-tile, .pt-box, .folder, .file-card { transition: transform .22s cubic-bezier(.2, .7, .2, 1), box-shadow .22s, border-color .2s, background-color .2s; }
.stat:hover, .tile:hover, .app-card:hover, .tpl-card:hover, .pt-tile:hover, .file-card:hover, .folder:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(26, 26, 26, .10); }
.btn { transition: transform .15s, background-color .15s, box-shadow .15s, border-color .15s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.nav__item svg { transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.nav__item:hover svg { transform: scale(1.14) rotate(-4deg); }
.nav__item.is-active { animation: pl-fade .35s ease both; }
.badge { animation: pl-pop .3s cubic-bezier(.3, 1.4, .5, 1) both; }
.alert { animation: pl-slide .4s cubic-bezier(.2, .7, .2, 1) both; }
.modal__box { animation: pl-pop .22s cubic-bezier(.2, .8, .3, 1) both; }
.co-dd__menu { animation: pl-pop .16s ease both; transform-origin: top; }
.att-pill__dot, .hr-dot.is-on { animation: pl-pulse 2s infinite; }
.tai__fab { animation: pl-pop .5s .4s cubic-bezier(.3, 1.4, .5, 1) both; }
.co-av { transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.co-card:hover .co-av { transform: scale(1.08) rotate(-3deg); }
.theme-toggle svg { transition: transform .5s cubic-bezier(.3, 1.6, .5, 1), opacity .2s; }
.theme-toggle:hover svg { transform: rotate(25deg) scale(1.1); }
.dash-hero { background-image: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .06) 50%, transparent 70%) !important; background-size: 250% 100% !important; animation: pl-rise .45s both, pl-shimmer 9s linear 1s infinite; }

/* شريط التحميل أعلى الصفحة */
#pl-bar { position: fixed; top: 0; inset-inline: 0; height: 2px; z-index: 9999; pointer-events: none; opacity: 0; }
#pl-bar i { display: block; height: 100%; width: 0; background: var(--pl-text, #303030); box-shadow: 0 0 8px var(--pl-text, #303030); transition: width .4s ease; }
#pl-bar.is-on { opacity: 1; }

/* زرار الثيم */
.theme-toggle { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid #d6d6d6; background: #fdfdfd; color: #303030; cursor: pointer; box-shadow: 0 1px 0 rgba(26, 26, 26, .07); padding: 0; }
.theme-toggle:hover { background: #f1f1f1; }
.theme-toggle .ic-moon { display: none; }
html[data-theme="dark"] .theme-toggle .ic-sun { display: none; }
html[data-theme="dark"] .theme-toggle .ic-moon { display: block; }
.theme-toggle--fab { position: fixed; z-index: 80; inset-inline-start: 16px; bottom: 16px; width: 38px; height: 38px; border-radius: 50%; box-shadow: 0 4px 14px rgba(0, 0, 0, .15); }

/* تنقّل سلس بين الألوان عند تبديل الثيم */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after { transition: background-color .35s ease, color .35s ease, border-color .35s ease, fill .35s ease !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print { *, *::before, *::after { animation: none !important; } }

/* v1.68 — سكرول ناعم وأشرطة رفيعة وظهور تدريجي */
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
* { scrollbar-width: thin; scrollbar-color: rgba(120, 120, 120, .45) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: rgba(120, 120, 120, .4); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(120, 120, 120, .65); background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }
.sidebar .nav { overscroll-behavior: contain; }
.topbar { position: sticky; top: 0; z-index: 30; backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); transition: box-shadow .2s, background-color .2s; }
.topbar.is-scrolled { box-shadow: 0 1px 0 var(--pl-border, #e3e3e3), 0 8px 24px rgba(0, 0, 0, .06); }
.rv { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1); animation: none !important; }
.rv.in { opacity: 1; transform: none; }
.to-top { position: fixed; inset-inline-end: 18px; bottom: 84px; z-index: 40; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--pl-border, #e3e3e3); background: var(--pl-surface, #fff); color: var(--pl-text, #303030); display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, .15); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s; }
.to-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { transform: translateY(-2px); }
@media print { .to-top { display: none; } }

/* لوحة التحكم: حلقة الاعتماد وكروت الأرقام */
.dash-ring { position: relative; width: 104px; height: 104px; flex: none; display: grid; place-items: center; }
.dash-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
html[dir="rtl"] .dash-ring svg { transform: rotate(-90deg) scaleY(-1); }
.dash-ring__bg { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 3; }
.dash-ring__fg { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; animation: dash-ring 1.1s .2s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes dash-ring { from { stroke-dasharray: 0 100; } }
.dash-ring > div { position: relative; text-align: center; line-height: 1.1; }
.dash-ring b { font-size: 24px; }
.dash-ring i { font-style: normal; font-size: 12px; opacity: .7; margin-inline-start: 1px; }
.dash-ring span { display: block; font-size: 10.5px; opacity: .7; margin-top: 2px; }
a.dash-hero__stat { color: inherit; text-decoration: none; transition: background .15s, transform .15s; }
a.dash-hero__stat:hover { background: rgba(255, 255, 255, .15); transform: translateY(-2px); text-decoration: none; }
.dash-hero__side { align-items: center; }
.stat--link { display: block; color: inherit; text-decoration: none; position: relative; overflow: hidden; }
.stat--link::before { content: ""; position: absolute; inset-inline-start: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--pl-border, #e3e3e3); }
.stat--info::before { background: #4aa3ff; } .stat--warn::before { background: #f0b429; } .stat--ok::before { background: #36b37e; }
.stat--link:hover { text-decoration: none; transform: translateY(-2px); }
.dash-new__ico { display: none; }
.dash-new__row { grid-template-columns: minmax(0, 1fr); }

/* قايمة خطط المحتوى: من غير قص على الشاشة الضيقة */
.pl-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) auto minmax(130px, auto); }
.pl-row__due { white-space: normal; text-align: end; line-height: 1.5; }
.cp-tile { border-inline-start: 0; position: relative; }
.cp-tile::before { content: ""; position: absolute; inset-inline-start: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--accent); }
.pl-list { overflow: hidden; }
@media (max-width: 860px) {
  .pl-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .pl-row__prog { grid-column: 1 / -1; order: 3; }
  .pl-row__due { grid-column: 1 / -1; order: 4; text-align: start; }
}
