/* ==========================================================================
   منصة إدارة الأكاديمية، الهوية البصرية
   ملعب · حركة · وضوح. مبنية لدماغ يحتاج يشوف كل شي بنظرة واحدة.
   ========================================================================== */

:root {
  --ink:        #1b2127;
  --ink-soft:   #5d6b78;
  --ink-faint:  #8c99a6;
  --bg:         #f6f8f7;
  --bg-grad:    radial-gradient(1200px 520px at 88% -12%, #e6f1ea 0%, transparent 62%),
                radial-gradient(900px 440px at -10% 108%, #e8eef4 0%, transparent 58%);
  --card:       #ffffff;
  --card-soft:  #f7faf8;
  --line:       #e2e9e5;
  --line-soft:  #eef3f0;

  --brand:      #2e7d4f;
  --brand-deep: #1f5c39;
  --brand-soft: #e3f2e8;
  --accent:     #d79a2b;
  --alt:        #2f6f7d;

  --good:       #2f7d4f;  --good-bg:   #e4f3ea;
  --warn:       #a8711a;  --warn-bg:   #fbf0dc;
  --bad:        #b03a30;  --bad-bg:    #fae8e6;
  --info:       #2b5ca8;  --info-bg:   #e5ecf8;

  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --r-xl: 26px;

  --sh-1: 0 1px 2px rgba(27,45,38,.05), 0 4px 14px rgba(27,45,38,.055);
  --sh-2: 0 2px 6px rgba(27,45,38,.07), 0 14px 36px rgba(27,45,38,.10);
  --sh-3: 0 6px 18px rgba(27,45,38,.12), 0 24px 60px rgba(27,45,38,.16);

  --nav-w: 238px;
  --top-h: 58px;
  --ease: cubic-bezier(.33, .9, .3, 1);
}

[data-theme="dark"] {
  --ink:        #e9eef2;
  --ink-soft:   #9fb0bd;
  --ink-faint:  #76868f;
  --bg:         #14161c;
  --bg-grad:    radial-gradient(1100px 480px at 85% -10%, #1c2130 0%, transparent 60%),
                radial-gradient(900px 420px at -10% 110%, #171a24 0%, transparent 55%);
  --card:       #1d2029;
  --card-soft:  #232733;
  --line:       #303644;
  --line-soft:  #272c37;

  --good: #6fc48d;  --good-bg: #1c2f24;
  --warn: #ddab55;  --warn-bg: #332a1a;
  --bad:  #e8857a;  --bad-bg:  #35211f;
  --info: #86aae8;  --info-bg: #1d2740;

  --sh-1: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.3);
  --sh-2: 0 2px 8px rgba(0,0,0,.4), 0 14px 36px rgba(0,0,0,.4);
  --sh-3: 0 8px 22px rgba(0,0,0,.5), 0 28px 64px rgba(0,0,0,.5);
}

/* ---------------------------------------------------------------- */
/*  الأساسيات                                                        */
/* ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
svg.ic { flex-shrink: 0; vertical-align: -.17em; }

::selection { background: var(--brand); color: #fff; }

:focus-visible {
  outline: 2.5px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------------------------------------------------------------- */
/*  حركات                                                           */
/* ---------------------------------------------------------------- */
@keyframes rise   { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pop    { 0% { transform: scale(.7); opacity: 0; } 65% { transform: scale(1.07); } 100% { transform: scale(1); opacity: 1; } }
@keyframes glow   { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes grow   { from { transform: scaleX(0); } }
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes shake  { 10%,90% { transform: translateX(-1px); } 30%,70% { transform: translateX(2px); } 50% { transform: translateX(-2px); } }
@keyframes fall   { to { transform: translateY(105vh) rotate(720deg); opacity: 0; } }
@keyframes ringIn { from { stroke-dashoffset: 999; } }

/* ---------------------------------------------------------------- */
/*  الشريط العلوي                                                    */
/* ---------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--top-h);
  display: flex; align-items: center; gap: .5rem;
  padding: 0 .85rem;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(140deg, var(--brand), var(--brand-deep));
  color: #fff;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--brand) 40%, transparent);
}
.brand-txt { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.top-actions { display: flex; align-items: center; gap: .35rem; margin-inline-start: auto; }

.icon-btn {
  width: 36px; height: 36px; flex-shrink: 0;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--card); color: var(--ink-soft);
  cursor: pointer; position: relative;
  transition: color .18s, border-color .18s, background .18s, transform .18s;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-1px); }
.icon-btn .dot {
  position: absolute; top: -5px; inset-inline-end: -5px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--bad); color: #fff;
  font-size: .65rem; font-weight: 700; line-height: 17px; text-align: center;
  box-shadow: 0 0 0 2px var(--card);
}

.chip-streak, .chip-level {
  display: inline-flex; align-items: center; gap: .25rem;
  height: 30px; padding: 0 .6rem; border-radius: 99px;
  font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chip-streak { background: var(--warn-bg); color: var(--warn); }
.chip-level  { background: var(--brand-soft); color: var(--brand-deep); }

.only-mobile { display: none; }

/* ---------------------------------------------------------------- */
/*  القائمة الجانبية                                                 */
/* ---------------------------------------------------------------- */
.shell { display: flex; align-items: flex-start; }

.sidenav {
  width: var(--nav-w); flex-shrink: 0;
  position: sticky; top: var(--top-h);
  height: calc(100vh - var(--top-h));
  overflow-y: auto; overscroll-behavior: contain;
  padding: .9rem .55rem 2rem;
  border-inline-end: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 55%, transparent);
  scrollbar-width: thin;
}
.sidenav::-webkit-scrollbar { width: 6px; }
.sidenav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 9px; }

.nav-group {
  font-size: .7rem; font-weight: 700; letter-spacing: .06em;
  color: var(--ink-faint); text-transform: uppercase;
  padding: .9rem .75rem .3rem;
}
.nav-group:first-child { padding-top: .2rem; }

.sidenav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .75rem; margin-bottom: 1px;
  border-radius: 11px;
  color: var(--ink-soft); font-weight: 500; font-size: .92rem;
  transition: background .16s, color .16s, transform .16s;
}
.sidenav a:hover { background: var(--brand-soft); color: var(--brand-deep); transform: translateX(-2px); }
.sidenav a.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff; font-weight: 600;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 32%, transparent);
}
.sidenav a.active:hover { transform: none; color: #fff; }
.sidenav .badge {
  margin-inline-start: auto;
  background: var(--bad); color: #fff;
  border-radius: 99px; font-size: .7rem; font-weight: 700;
  padding: 0 .45rem; line-height: 1.45;
}
.sidenav a.active .badge { background: rgba(255,255,255,.26); }

.scrim {
  display: none; position: fixed; inset: 0; z-index: 45;
  background: rgba(10,16,20,.5); backdrop-filter: blur(2px);
}

/* ---------------------------------------------------------------- */
/*  المحتوى                                                          */
/* ---------------------------------------------------------------- */
.content {
  flex: 1; min-width: 0;
  padding: 1.5rem 1.6rem 4rem;
  max-width: 1180px;
  animation: rise .4s var(--ease) both;
}

.page-head { margin-bottom: 1.2rem; }
.page-head h1 {
  font-size: 1.55rem; letter-spacing: -.01em;
  display: inline-block; position: relative; padding-bottom: .4rem;
}
.page-head h1::after {
  content: ''; position: absolute; inset-inline-start: 0; bottom: 0;
  width: 46px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
.page-sub { color: var(--ink-soft); font-size: .92rem; margin-top: .45rem; }

.section-title {
  font-size: .78rem; font-weight: 700; letter-spacing: .06em;
  color: var(--ink-faint); text-transform: uppercase;
  margin: 1.6rem 0 .7rem;
  display: flex; align-items: center; gap: .4rem;
}
.section-title:first-child { margin-top: 0; }

/* ---------------------------------------------------------------- */
/*  البطاقات والشبكات                                                */
/* ---------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  padding: 1.15rem 1.2rem;
  margin-bottom: 1rem;
  transition: box-shadow .25s, border-color .25s, transform .2s;
  animation: rise .42s var(--ease) both;
}
.card.flat { box-shadow: none; background: var(--card-soft); }
.card.pad-0 { padding: 0; overflow: hidden; }
.card > h2 {
  font-size: 1.02rem; margin-bottom: .75rem;
  display: flex; align-items: center; gap: .45rem;
}
.card > h2 .ic { color: var(--brand); }
.card-note { font-size: .86rem; color: var(--ink-soft); margin-top: -.35rem; margin-bottom: .8rem; }

.grid { display: grid; gap: .9rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.g-wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

/* ---------------------------------------------------------------- */
/*  بطاقات الإحصاء                                                   */
/* ---------------------------------------------------------------- */
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1rem 1.05rem;
  position: relative; overflow: hidden; display: block;
  box-shadow: var(--sh-1);
  transition: transform .2s var(--ease), box-shadow .25s;
  animation: rise .45s var(--ease) both;
}
a.stat:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.stat::before {
  content: ''; position: absolute; inset-inline: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
.stat-ico { color: var(--brand); opacity: .75; margin-bottom: .45rem; }
.stat-val {
  font-size: 1.75rem; font-weight: 700; line-height: 1.15;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.stat-lbl { font-size: .85rem; color: var(--ink-soft); margin-top: .1rem; }
.stat-note { font-size: .78rem; color: var(--ink-faint); margin-top: .3rem; }
.stat.good .stat-val { color: var(--good); } .stat.good::before { background: var(--good); } .stat.good .stat-ico { color: var(--good); }
.stat.bad  .stat-val { color: var(--bad);  } .stat.bad::before  { background: var(--bad);  } .stat.bad .stat-ico  { color: var(--bad);  }
.stat.warn .stat-val { color: var(--warn); } .stat.warn::before { background: var(--warn); } .stat.warn .stat-ico { color: var(--warn); }

/* ---------------------------------------------------------------- */
/*  الأزرار                                                          */
/* ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .58rem 1.15rem; border: 1px solid transparent; border-radius: 12px;
  font-size: .92rem; font-weight: 600; cursor: pointer;
  background: var(--card-soft); color: var(--ink); border-color: var(--line);
  transition: transform .16s, box-shadow .2s, background .18s, border-color .18s, color .18s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--sh-1); }
.btn:active { transform: none; }
.btn.brand {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff; border-color: transparent;
}
.btn.brand:hover { box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 38%, transparent); }
.btn.accent { background: var(--accent); color: #1b1505; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.bad { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.btn.sm { padding: .32rem .8rem; font-size: .82rem; border-radius: 9px; }
.btn.lg { padding: .8rem 1.7rem; font-size: 1.02rem; border-radius: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .ic { opacity: .9; }

.icon-act {
  width: 30px; height: 30px; border-radius: 9px;
  display: inline-grid; place-items: center;
  color: var(--ink-faint); border: 1px solid transparent;
  background: transparent; cursor: pointer;
  transition: color .16s, background .16s;
}
.icon-act:hover { color: var(--bad); background: var(--bad-bg); }
.icon-act.plain:hover { color: var(--brand); background: var(--brand-soft); }

/* ---------------------------------------------------------------- */
/*  النماذج                                                          */
/* ---------------------------------------------------------------- */
label { display: block; font-size: .83rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .28rem; }

input, select, textarea {
  width: 100%; padding: .58rem .75rem;
  border: 1.5px solid var(--line); border-radius: 11px;
  font-family: inherit; font-size: .93rem;
  background: var(--card); color: var(--ink);
  transition: border-color .18s, box-shadow .18s;
}
textarea { resize: vertical; min-height: 92px; line-height: 1.75; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--brand) 16%, transparent);
}
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); }
select { appearance: none; background-image: none; cursor: pointer; }

.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: .8rem; }
.fgrid .full { grid-column: 1 / -1; }
.field { min-width: 0; }
.hint { font-size: .78rem; color: var(--ink-faint); margin-top: .22rem; }

/* شريط مدخل سريع */
.quick-add {
  display: flex; gap: .5rem; align-items: stretch;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: .4rem; box-shadow: var(--sh-1);
  margin-bottom: 1rem;
}
.quick-add input, .quick-add select { border: 0; background: transparent; box-shadow: none !important; }
.quick-add input:focus, .quick-add select:focus { box-shadow: none; }
.quick-add input[type="text"] { flex: 1; min-width: 120px; }
.quick-add select { width: auto; max-width: 150px; color: var(--ink-soft); font-size: .86rem; }

/* ---------------------------------------------------------------- */
/*  الرقائق والشارات                                                 */
/* ---------------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .12rem .62rem; border-radius: 99px;
  font-size: .78rem; font-weight: 600; white-space: nowrap;
  background: var(--card-soft); color: var(--ink-soft);
  border: 1px solid var(--line);
}
.chip.brand { background: var(--brand-soft); color: var(--brand-deep); border-color: transparent; }
.chip.good  { background: var(--good-bg); color: var(--good); border-color: transparent; }
.chip.warn  { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip.bad   { background: var(--bad-bg);  color: var(--bad);  border-color: transparent; }
.chip.info  { background: var(--info-bg); color: var(--info); border-color: transparent; }
.chip.solid { background: var(--brand); color: #fff; border-color: transparent; }

/* ---------------------------------------------------------------- */
/*  التبويبات والمقاطع                                               */
/* ---------------------------------------------------------------- */
.tabs {
  display: flex; gap: .35rem; flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.tab {
  padding: .4rem 1rem; border-radius: 99px;
  border: 1.5px solid var(--line); background: var(--card);
  color: var(--ink-soft); font-weight: 600; font-size: .87rem;
  cursor: pointer; transition: all .18s;
}
.tab:hover { border-color: var(--brand); color: var(--brand); }
.tab.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 26%, transparent);
}

.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--card-soft); border: 1px solid var(--line);
  border-radius: 12px;
}
.seg a, .seg button {
  padding: .35rem .9rem; border-radius: 9px; border: 0; background: transparent;
  font-size: .85rem; font-weight: 600; color: var(--ink-soft); cursor: pointer;
  transition: all .18s;
}
.seg a.active, .seg button.active { background: var(--card); color: var(--brand-deep); box-shadow: var(--sh-1); }

/* ---------------------------------------------------------------- */
/*  التقويم                                                          */
/* ---------------------------------------------------------------- */
.cal-top {
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: .9rem; flex-wrap: wrap;
}
.cal-month { font-size: 1.15rem; font-weight: 700; min-width: 150px; }

.cal {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: .7rem;
  box-shadow: var(--sh-1); overflow: hidden;
}
.cal-head {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; margin-bottom: 5px;
}
.cal-head span {
  text-align: center; font-size: .72rem; font-weight: 700;
  color: var(--ink-faint); padding: .3rem 0;
}
.cal-body { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }

.cell {
  position: relative; min-height: 74px;
  border: 1.5px solid transparent; border-radius: 13px;
  padding: .35rem .4rem;
  background: var(--card-soft);
  display: flex; flex-direction: column; gap: 2px;
  transition: transform .16s var(--ease), box-shadow .2s, border-color .18s, background .18s;
  animation: rise .3s var(--ease) both;
}
.cell:hover { transform: translateY(-2px) scale(1.015); box-shadow: var(--sh-2); z-index: 2; }
.cell.muted { opacity: .38; }
.cell .dnum {
  font-size: .9rem; font-weight: 700; font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

/* يوم حصة */
.cell.train {
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--brand) 16%, var(--card)),
    color-mix(in srgb, var(--brand) 7%, var(--card)));
  border-color: color-mix(in srgb, var(--brand) 38%, transparent);
}
.cell.train .dnum { color: var(--brand-deep); }
.cell .train-tag {
  font-size: .64rem; font-weight: 700; color: var(--brand-deep);
  background: color-mix(in srgb, var(--brand) 20%, transparent);
  border-radius: 6px; padding: 0 .3rem; align-self: flex-start;
  display: inline-flex; align-items: center; gap: .15rem;
}

/* اليوم */
.cell.today {
  border-color: var(--accent); border-width: 2px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.cell.today .dnum { color: var(--accent); }
.cell.past { opacity: .72; }

.cell-dots { display: flex; gap: 3px; margin-top: auto; flex-wrap: wrap; }
.cdot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 99px; background: var(--ink-faint); display: inline-block; }
.cdot.ev  { background: var(--accent); }
.cdot.tk  { background: var(--info); }
.cdot.les { background: var(--brand); }
.cdot.ide{ background: var(--alt); }

.cell-mini {
  font-size: .66rem; line-height: 1.35; color: var(--ink-soft);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.cal-legend {
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin-top: .8rem; font-size: .78rem; color: var(--ink-soft);
}
.cal-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.cal-legend .cdot { align-self: center; }

/* ---------------------------------------------------------------- */
/*  الحلقات والأشرطة                                                 */
/* ---------------------------------------------------------------- */
.ring { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring-bg { stroke: var(--line); }
.ring-fg {
  stroke: var(--brand); stroke-linecap: round;
  transition: stroke-dashoffset 1s var(--ease);
  animation: ringIn 1.1s var(--ease) both;
}
.ring-mid {
  position: absolute; font-weight: 700; font-size: .95rem;
  font-variant-numeric: tabular-nums; text-align: center; line-height: 1.2;
}
.ring-mid small { display: block; font-size: .62rem; font-weight: 500; color: var(--ink-faint); }

.bar { margin-bottom: .8rem; }
.bar-top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: .87rem; margin-bottom: .25rem; gap: .5rem;
}
.bar-top b { font-variant-numeric: tabular-nums; }
.bar-track { height: 9px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 99px; transform-origin: right center;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  animation: grow .9s var(--ease) both;
}
.bar-fill.good { background: linear-gradient(90deg, var(--good), #7fc49a); }
.bar-fill.bad  { background: linear-gradient(90deg, var(--bad), #e8857a); }
.bar-fill.alt  { background: linear-gradient(90deg, var(--alt), var(--info)); }

/* ---------------------------------------------------------------- */
/*  المهام                                                           */
/* ---------------------------------------------------------------- */
.task {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .7rem .85rem; margin-bottom: .45rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 13px;
  transition: transform .18s var(--ease), box-shadow .2s, opacity .3s;
  animation: rise .35s var(--ease) both;
}
.task:hover { transform: translateX(-3px); box-shadow: var(--sh-1); }
.task .tick {
  width: 23px; height: 23px; flex-shrink: 0; margin-top: 1px;
  border: 2px solid var(--line); border-radius: 7px;
  display: grid; place-items: center; cursor: pointer;
  background: transparent; color: transparent;
  transition: all .2s;
}
.task .tick:hover { border-color: var(--brand); color: color-mix(in srgb, var(--brand) 45%, transparent); }
.task.done { opacity: .55; }
.task.done .tick { background: var(--brand); border-color: var(--brand); color: #fff; }
.task.done .t-title { text-decoration: line-through; color: var(--ink-faint); }
.t-main { flex: 1; min-width: 0; }
.t-title { font-weight: 500; font-size: .94rem; }
.t-meta { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .25rem; font-size: .74rem; color: var(--ink-faint); }
.t-meta .ic { width: 13px; height: 13px; }
.task.hi { border-inline-start: 3px solid var(--accent); }
.task.late { border-inline-start: 3px solid var(--bad); }
.task.late .t-meta { color: var(--bad); }

/* ---------------------------------------------------------------- */
/*  وضع التركيز                                                      */
/* ---------------------------------------------------------------- */
.focus-wrap {
  min-height: 56vh; display: grid; place-items: center; text-align: center;
  padding: 1rem;
}
.focus-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 26px; padding: 2.4rem 1.8rem;
  box-shadow: var(--sh-2); max-width: 540px; width: 100%;
  position: relative; overflow: hidden;
  animation: pop .45s var(--ease) both;
}
.focus-card::before {
  content: ''; position: absolute; inset-inline: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--accent), var(--brand));
}
.focus-kicker {
  font-size: .76rem; font-weight: 700; letter-spacing: .08em;
  color: var(--ink-faint); text-transform: uppercase; margin-bottom: .7rem;
}
.focus-title { font-size: 1.55rem; line-height: 1.4; margin-bottom: .6rem; }
.focus-notes { color: var(--ink-soft); font-size: .93rem; margin-bottom: 1.1rem; white-space: pre-wrap; }
.focus-meta { display: flex; gap: .45rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.focus-acts { display: flex; gap: .55rem; justify-content: center; flex-wrap: wrap; }

.timer-big {
  font-size: 3.2rem; font-weight: 700; font-variant-numeric: tabular-nums;
  letter-spacing: -.02em; line-height: 1; margin: .3rem 0 1rem;
}
.timer-big.run { color: var(--brand); }

/* نبض الأسبوع */
.pulse-week { display: flex; gap: .45rem; align-items: flex-end; height: 72px; }
.pulse-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; height: 100%; justify-content: flex-end; }
.pulse-bar {
  width: 100%; max-width: 30px; border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 55%, transparent));
  min-height: 4px; transform-origin: bottom;
  animation: grow .7s var(--ease) both; transform: scaleY(1);
}
.pulse-bar.zero { background: var(--line); }
.pulse-bar.now { background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 50%, transparent)); }
.pulse-lbl { font-size: .64rem; color: var(--ink-faint); white-space: nowrap; }

/* احتفال */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 999; overflow: hidden; }
.confetti i {
  position: absolute; top: -14px; width: 8px; height: 13px; border-radius: 2px;
  animation: fall 2.3s linear forwards;
}
.toast {
  position: fixed; inset-inline: 0; bottom: 24px; z-index: 998;
  display: flex; justify-content: center; pointer-events: none;
}
.toast > div {
  background: var(--ink); color: var(--bg);
  padding: .7rem 1.3rem; border-radius: 99px;
  font-weight: 600; font-size: .92rem;
  box-shadow: var(--sh-3); animation: pop .35s var(--ease) both;
  display: inline-flex; align-items: center; gap: .45rem;
}

/* ---------------------------------------------------------------- */
/*  التنبيهات                                                        */
/* ---------------------------------------------------------------- */
.alert {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .9rem 1rem; margin-bottom: .6rem;
  border-radius: 14px; border: 1px solid var(--line);
  border-inline-start: 4px solid var(--ink-faint);
  background: var(--card);
  transition: transform .18s, box-shadow .2s;
  animation: rise .35s var(--ease) both;
}
.alert:hover { transform: translateX(-3px); box-shadow: var(--sh-1); }
.alert .a-ico { flex-shrink: 0; margin-top: 2px; }
.alert .a-body { flex: 1; min-width: 0; }
.alert .a-title { font-weight: 700; font-size: .95rem; }
.alert .a-msg { font-size: .88rem; color: var(--ink-soft); margin-top: .1rem; }
.alert .a-act { font-size: .85rem; font-weight: 600; margin-top: .35rem; }
.alert.danger { border-inline-start-color: var(--bad);  background: color-mix(in srgb, var(--bad-bg) 55%, var(--card)); }
.alert.danger .a-ico, .alert.danger .a-act { color: var(--bad); }
.alert.warn   { border-inline-start-color: var(--warn); background: color-mix(in srgb, var(--warn-bg) 55%, var(--card)); }
.alert.warn .a-ico, .alert.warn .a-act { color: var(--warn); }
.alert.good   { border-inline-start-color: var(--good); background: color-mix(in srgb, var(--good-bg) 55%, var(--card)); }
.alert.good .a-ico, .alert.good .a-act { color: var(--good); }
.alert.info   { border-inline-start-color: var(--info); background: color-mix(in srgb, var(--info-bg) 55%, var(--card)); }
.alert.info .a-ico, .alert.info .a-act { color: var(--info); }
.alert.seen { opacity: .6; }

.flash {
  display: flex; align-items: center; gap: .45rem;
  padding: .65rem 1rem; border-radius: 12px; margin-bottom: 1rem;
  font-weight: 600; font-size: .9rem;
  animation: rise .3s var(--ease) both;
}
.flash.good { background: var(--good-bg); color: var(--good); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.flash.bad  { background: var(--bad-bg);  color: var(--bad); animation: shake .4s; }

/* ---------------------------------------------------------------- */
/*  بطاقات الأفكار                                                   */
/* ---------------------------------------------------------------- */
.idea {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1rem 1.05rem;
  box-shadow: var(--sh-1); position: relative;
  transition: transform .2s var(--ease), box-shadow .25s;
  animation: rise .4s var(--ease) both;
  display: flex; flex-direction: column; gap: .5rem;
}
.idea:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.idea-h { display: flex; align-items: flex-start; gap: .5rem; }
.idea-t { font-weight: 700; font-size: .98rem; flex: 1; min-width: 0; line-height: 1.4; }
.idea-c { font-size: .88rem; color: var(--ink-soft); line-height: 1.75; white-space: pre-wrap; }
.idea-c.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.idea-f { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-top: auto; padding-top: .3rem; }
.idea.pick { border: 2px dashed var(--brand); background: color-mix(in srgb, var(--brand-soft) 60%, var(--card)); }

.score { display: inline-flex; gap: 2px; align-items: center; }
.score i { width: 5px; height: 12px; border-radius: 2px; background: var(--line); }
.score i.on { background: var(--brand); }
.score.effort i.on { background: var(--warn); }

/* مجلدات قابلة للطي */
.folder {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--card); margin-bottom: .7rem; overflow: hidden;
  box-shadow: var(--sh-1);
}
.folder > summary {
  cursor: pointer; list-style: none; padding: .85rem 1.05rem;
  font-weight: 700; display: flex; align-items: center; gap: .55rem;
  transition: background .18s;
}
.folder > summary::-webkit-details-marker { display: none; }
.folder > summary:hover { background: var(--card-soft); }
.folder > summary .ic:first-child { color: var(--brand); }
.folder > summary .count { margin-inline-start: auto; font-size: .78rem; font-weight: 500; color: var(--ink-faint); }
.folder[open] > summary { border-bottom: 1px solid var(--line); background: var(--card-soft); }
.folder-body { padding: 1rem 1.05rem; }

/* ---------------------------------------------------------------- */
/*  مخرجات الذكاء الاصطناعي                                           */
/* ---------------------------------------------------------------- */
.ai-out {
  background: var(--card-soft); border: 1px solid var(--line);
  border-inline-start: 3px solid var(--brand);
  border-radius: 14px; padding: 1.1rem 1.2rem;
  font-size: .93rem; line-height: 1.95;
  animation: rise .4s var(--ease) both;
}
.ai-out h4 { font-size: .95rem; color: var(--brand-deep); margin: 1rem 0 .3rem; }
.ai-out h4:first-child { margin-top: 0; }
.ai-out ul { margin: .3rem 0; padding-inline-start: 1.1rem; }
.ai-out li { margin-bottom: .2rem; }
.ai-out b { color: var(--ink); }

.ai-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .72rem; font-weight: 700; padding: .1rem .5rem;
  border-radius: 99px; background: var(--brand-soft); color: var(--brand-deep);
}

.thinking { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink-soft); font-size: .9rem; }
.thinking .sp {
  width: 15px; height: 15px; border-radius: 99px;
  border: 2px solid var(--line); border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}

/* ---------------------------------------------------------------- */
/*  المحادثة                                                         */
/* ---------------------------------------------------------------- */
.chat-scroll {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1rem;
  height: min(58vh, 520px); overflow-y: auto;
  margin-bottom: .8rem; box-shadow: var(--sh-1);
  display: flex; flex-direction: column; gap: .6rem;
}
.msg {
  max-width: 82%; padding: .7rem .95rem; border-radius: 16px;
  font-size: .92rem; line-height: 1.8; white-space: pre-wrap;
  animation: rise .28s var(--ease) both;
}
.msg.me {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff; align-self: flex-start; border-end-start-radius: 5px;
}
.msg.ai {
  background: var(--card-soft); border: 1px solid var(--line);
  align-self: flex-end; border-end-end-radius: 5px;
}
.chat-form { display: flex; gap: .5rem; }
.chat-form input { flex: 1; }

/* الشخصيات */
.char {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1.1rem; text-align: center;
  box-shadow: var(--sh-1); position: relative; overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .25s;
  animation: rise .4s var(--ease) both; display: block;
}
.char:hover { transform: translateY(-4px); box-shadow: var(--sh-2); }
.char::before { content: ''; position: absolute; inset-inline: 0; top: 0; height: 3px; background: var(--cc, var(--brand)); }
.char-face {
  width: 56px; height: 56px; border-radius: 18px; margin: 0 auto .6rem;
  display: grid; place-items: center; color: #fff;
  background: var(--cc, var(--brand));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 30%, transparent);
}
.char-name { font-weight: 700; font-size: 1rem; }
.char-role { font-size: .8rem; color: var(--ink-soft); margin-top: .1rem; }

/* ---------------------------------------------------------------- */
/*  الجداول                                                          */
/* ---------------------------------------------------------------- */
.tbl-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); }
.tbl { width: 100%; border-collapse: collapse; font-size: .89rem; }
.tbl th {
  text-align: right; padding: .65rem .8rem; white-space: nowrap;
  background: var(--card-soft); font-weight: 600; font-size: .82rem;
  color: var(--ink-soft); border-bottom: 1px solid var(--line);
  position: sticky; top: 0;
}
.tbl td { padding: .62rem .8rem; border-bottom: 1px solid var(--line-soft); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .14s; }
.tbl tbody tr:hover td { background: var(--card-soft); }
.tbl .n { font-variant-numeric: tabular-nums; }
.pos { color: var(--good); font-weight: 700; }
.neg { color: var(--bad); font-weight: 700; }

/* ---------------------------------------------------------------- */
/*  حالة الفراغ                                                      */
/* ---------------------------------------------------------------- */
.empty { text-align: center; padding: 2.4rem 1rem; color: var(--ink-soft); }
.empty-ico { color: var(--line); margin-bottom: .6rem; }
[data-theme="dark"] .empty-ico { color: var(--ink-faint); opacity: .4; }
.empty-t { font-weight: 700; font-size: 1rem; color: var(--ink); }
.empty-m { font-size: .88rem; margin: .3rem 0 1rem; }

.muted { color: var(--ink-soft); font-size: .87rem; }
.faint { color: var(--ink-faint); font-size: .8rem; }
.nums { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.center { text-align: center; }
.mt { margin-top: 1rem; } .mt-2 { margin-top: 1.8rem; }
.mb { margin-bottom: 1rem; }
.hide { display: none !important; }

/* ---------------------------------------------------------------- */
/*  صفحة الدخول                                                      */
/* ---------------------------------------------------------------- */
.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 1.2rem;
  background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed;
}
.auth-card {
  width: 100%; max-width: 410px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 24px; box-shadow: var(--sh-3);
  padding: 2.2rem 1.9rem; position: relative; overflow: hidden;
  animation: pop .45s var(--ease) both;
}
.auth-card::before {
  content: ''; position: absolute; inset-inline: 0; top: 0; height: 5px;
  background: linear-gradient(90deg, var(--brand), var(--accent), var(--brand));
}
.auth-mark {
  width: 54px; height: 54px; border-radius: 17px; margin: 0 auto 1rem;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--brand-deep));
  box-shadow: 0 6px 20px color-mix(in srgb, var(--brand) 35%, transparent);
}
.auth-card h1 { font-size: 1.3rem; text-align: center; }
.auth-card .sub { text-align: center; color: var(--ink-soft); font-size: .88rem; margin: .3rem 0 1.5rem; }
.auth-card .field + .field { margin-top: .85rem; }
.auth-card .btn { margin-top: 1.3rem; }
.auth-foot { text-align: center; font-size: .78rem; color: var(--ink-faint); margin-top: 1.1rem; }

/* ---------------------------------------------------------------- */
/*  الجوال                                                           */
/* ---------------------------------------------------------------- */
@media (max-width: 980px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .only-mobile { display: grid; }
  .content { padding: 1.1rem 1rem 4rem; }
  .brand-txt { max-width: 38vw; }

  .sidenav {
    position: fixed; z-index: 50;
    inset-block: var(--top-h) 0; inset-inline-start: 0;
    width: 262px; height: auto;
    background: var(--card);
    transform: translateX(100%);
    transition: transform .26s var(--ease);
    box-shadow: none;
  }
  body.nav-open .sidenav { transform: none; box-shadow: var(--sh-3); }
  body.nav-open .scrim { display: block; }

  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .cell { min-height: 58px; padding: .25rem .3rem; border-radius: 10px; }
  .cell .dnum { font-size: .82rem; }
  .cell-mini, .cell .train-tag { display: none; }
  .cal { padding: .45rem; border-radius: 18px; }
  .cal-body, .cal-head { gap: 3px; }
  .msg { max-width: 92%; }
  .focus-card { padding: 1.7rem 1.2rem; border-radius: 20px; }
  .focus-title { font-size: 1.3rem; }
  .timer-big { font-size: 2.6rem; }
  .page-head h1 { font-size: 1.35rem; }
  .stat-val { font-size: 1.5rem; }
  .chip-streak, .chip-level { height: 28px; padding: 0 .45rem; font-size: .76rem; }
}

@media (max-width: 420px) {
  .brand-txt { display: none; }
}

@media print {
  .topbar, .sidenav, .scrim, .btn, .icon-btn, .icon-act { display: none !important; }
  .content { max-width: none; padding: 0; }
  .card, .ai-out { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   أيقونة المعلومات: الشرح يظهر عند المرور بالفأرة أو اللمس
   ========================================================================== */
.ihint {
  display: inline-grid; place-items: center;
  width: 19px; height: 19px; flex-shrink: 0;
  border-radius: 50%; cursor: help;
  color: var(--ink-faint);
  border: 1.4px solid var(--line);
  background: var(--card);
  font-size: .68rem; font-weight: 700; line-height: 1;
  vertical-align: -.22em;
  position: relative;
  transition: color .18s, border-color .18s, background .18s;
}
.ihint:hover, .ihint:focus-visible { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }

.ihint::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 9px);
  inset-inline-start: 50%;
  transform: translateX(50%) translateY(5px);
  width: max-content; max-width: min(320px, 78vw);
  padding: .6rem .8rem;
  border-radius: 12px;
  background: var(--ink); color: var(--bg);
  font-size: .8rem; font-weight: 500; line-height: 1.65;
  text-align: start; white-space: normal;
  box-shadow: var(--sh-3);
  opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  z-index: 90;
}
[dir="rtl"] .ihint::after { transform: translateX(50%) translateY(5px); }
.ihint::before {
  content: ''; position: absolute;
  bottom: calc(100% + 3px); inset-inline-start: 50%;
  transform: translateX(50%);
  border: 6px solid transparent; border-top-color: var(--ink);
  opacity: 0; transition: opacity .2s; z-index: 91;
}
.ihint:hover::after, .ihint:focus-visible::after,
.ihint.open::after { opacity: 1; transform: translateX(50%) translateY(0); }
.ihint:hover::before, .ihint:focus-visible::before, .ihint.open::before { opacity: 1; }

/* قريب من الحافة: اقلب الاتجاه */
.ihint.down::after { bottom: auto; top: calc(100% + 9px); }
.ihint.down::before { bottom: auto; top: calc(100% + 3px); border-top-color: transparent; border-bottom-color: var(--ink); }

/* عنوان فيه أيقونة شرح */
.with-tip { display: inline-flex; align-items: center; gap: .38rem; }

/* ==========================================================================
   مبدّل المظهر السريع
   ========================================================================== */
.theme-pop {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0;
  width: min(330px, 92vw);
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-3);
  padding: .9rem; z-index: 80;
  animation: pop .22s var(--ease) both;
}
.theme-pop[hidden] { display: none; }
.theme-pop h4 {
  font-size: .72rem; font-weight: 700; letter-spacing: .05em;
  color: var(--ink-faint); text-transform: uppercase;
  margin: .7rem 0 .45rem;
}
.theme-pop h4:first-child { margin-top: 0; }

.sw-row { display: flex; flex-wrap: wrap; gap: .38rem; }
.sw {
  width: 30px; height: 30px; border-radius: 10px; cursor: pointer;
  border: 2px solid transparent; padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
  transition: transform .2s var(--ease), border-color .18s;
}
.sw:hover { transform: scale(1.14) rotate(-5deg); }
.sw.on { border-color: var(--ink); transform: scale(1.1); }

.amb-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; }
.amb-opt {
  display: flex; flex-direction: column; align-items: center; gap: .22rem;
  padding: .5rem .25rem; border-radius: 11px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--card-soft);
  color: var(--ink-soft); font-size: .7rem; font-weight: 600;
  transition: all .18s;
}
.amb-opt:hover { border-color: var(--brand); color: var(--brand); }
.amb-opt.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-deep); }

.pop-wrap { position: relative; }

/* ==========================================================================
   شاشة الترحيب
   ========================================================================== */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: var(--r-xl);
  display: grid; place-items: center;
  min-height: clamp(360px, 62vh, 580px);
  margin-bottom: 1.2rem;
  text-align: center;
  padding: 2.4rem 1.4rem;
}
#heroCanvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: -1; border-radius: inherit;
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -2; border-radius: inherit;
  background:
    radial-gradient(72% 92% at 18% 14%, color-mix(in srgb, var(--brand) 52%, transparent), transparent 62%),
    radial-gradient(62% 82% at 84% 26%, color-mix(in srgb, var(--accent) 46%, transparent), transparent 60%),
    radial-gradient(82% 72% at 50% 96%, color-mix(in srgb, var(--alt) 44%, transparent), transparent 66%),
    var(--card-soft);
}
.hero-inner { max-width: 620px; position: relative; }

.hero-logo {
  width: 92px; height: 92px; margin: 0 auto 1.1rem;
  border-radius: 28px; overflow: hidden;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--card) 72%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid color-mix(in srgb, #fff 34%, transparent);
  box-shadow: 0 14px 44px rgba(0,0,0,.16);
  animation: heroUp .8s var(--ease) .05s both, float 7s ease-in-out 1s infinite;
}
.hero-logo img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.hero-logo .ic { color: var(--brand-deep); }

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes heroUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.hero-kicker {
  font-size: .78rem; font-weight: 700; letter-spacing: .12em;
  color: color-mix(in srgb, var(--ink) 58%, transparent);
  margin-bottom: .6rem;
  animation: heroUp .75s var(--ease) .14s both;
}
.hero-title {
  font-size: clamp(1.9rem, 5.4vw, 3.4rem); font-weight: 700;
  line-height: 1.16; letter-spacing: -.025em; color: var(--ink);
  animation: heroUp .8s var(--ease) .22s both;
}
.hero-title .shine {
  background: linear-gradient(100deg, var(--brand-deep), var(--accent), var(--alt), var(--brand-deep));
  background-size: 280% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 8s linear infinite;
}
@keyframes shine { to { background-position: 280% 0; } }

.hero-sub {
  margin-top: .9rem; font-size: clamp(.95rem, 2vw, 1.1rem);
  color: color-mix(in srgb, var(--ink) 70%, transparent); line-height: 1.75;
  animation: heroUp .8s var(--ease) .32s both;
}
.hero-chips {
  display: flex; gap: .45rem; justify-content: center; flex-wrap: wrap;
  margin-top: 1.1rem;
  animation: heroUp .8s var(--ease) .4s both;
}
.hero-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  background: color-mix(in srgb, var(--card) 76%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid color-mix(in srgb, #fff 26%, transparent);
  color: var(--ink);
  padding: .3rem .8rem; border-radius: 99px;
  font-size: .82rem; font-weight: 600;
}
.hero-acts {
  margin-top: 1.6rem; display: flex; gap: .55rem; justify-content: center; flex-wrap: wrap;
  animation: heroUp .8s var(--ease) .5s both;
}
.hero-acts .btn {
  background: var(--ink); color: var(--bg); border-color: transparent;
  padding: .78rem 2rem; border-radius: 99px; font-size: 1rem;
  box-shadow: 0 10px 32px rgba(0,0,0,.18);
}
.hero-acts .btn:hover { box-shadow: 0 16px 42px rgba(0,0,0,.24); }
.hero-acts .btn.soft {
  background: color-mix(in srgb, var(--card) 72%, transparent);
  color: var(--ink); backdrop-filter: blur(10px);
  border: 1px solid color-mix(in srgb, #fff 28%, transparent);
  box-shadow: none;
}

/* مراحل الصفحة الرئيسية */
.stage { display: none; }
.stage.on { display: block; animation: rise .5s var(--ease) both; }

/* الشعار في الشريط العلوي */
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.brand-mark.has-logo { background: var(--card-soft); border: 1px solid var(--line); padding: 2px; }

/* الشعار في صفحة الدخول */
.auth-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; padding: 6px; }
.auth-mark.has-logo { background: var(--card-soft); border: 1px solid var(--line); }

@media (max-width: 860px) {
  .hero { min-height: clamp(320px, 56vh, 460px); border-radius: var(--r-lg); padding: 1.8rem 1rem; }
  .hero-logo { width: 74px; height: 74px; border-radius: 22px; }
  .amb-row { grid-template-columns: repeat(4, 1fr); }
  .ihint::after { max-width: 72vw; }
}

/* الترحيب وحده في الشاشة: خله يملأها */
.stage[data-stage="welcome"].on .hero { min-height: clamp(420px, 74vh, 700px); }
