/* سجّة — ألوان الصحراء: رمل، حنّاء، ليل البادية، نخيل، ذهب */
:root {
  --bg: #f4ead7;
  --bg-2: #ecdcc0;
  --card: #fbf6ec;
  --card-2: #f6eddc;
  --ink: #3a2a1c;
  --ink-2: #6f5a45;
  --line: #e2cfae;
  --henna: #9c3f2a;
  --henna-soft: #f3ddd2;
  --clay: #b5673f;
  --gold: #c08a2e;
  --gold-soft: #f5e6c4;
  --palm: #2f5b4c;
  --palm-soft: #dcebe2;
  --night: #1c2433;
  --night-2: #2b3650;
  --sand-on-night: #efdcb8;
  --shadow: 0 1px 2px rgba(80, 50, 20, .06), 0 6px 18px rgba(80, 50, 20, .08);
  --radius: 18px;
  --font: 'Cairo', Tahoma, Arial, sans-serif;
  --display: 'Reem Kufi', 'Tajawal', sans-serif;
  --quran: 'Amiri', 'Traditional Arabic', serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141925; --bg-2: #1a2130; --card: #1f2736; --card-2: #252f41;
    --ink: #f1e4c9; --ink-2: #b9a88b; --line: #34405a;
    --henna: #e08a6c; --henna-soft: #3a2724; --clay: #d08a5f;
    --gold: #e0b35c; --gold-soft: #3a3222; --palm: #7cc3a5; --palm-soft: #1f3530;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 22px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141925; --bg-2: #1a2130; --card: #1f2736; --card-2: #252f41;
  --ink: #f1e4c9; --ink-2: #b9a88b; --line: #34405a;
  --henna: #e08a6c; --henna-soft: #3a2724; --clay: #d08a5f;
  --gold: #e0b35c; --gold-soft: #3a3222; --palm: #7cc3a5; --palm-soft: #1f3530;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 22px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  background-image: radial-gradient(circle at 20% 0%, var(--bg-2), transparent 55%);
  min-height: 100vh; line-height: 1.6;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ───── شريط السدو ───── */
.sadu {
  height: 14px;
  background-color: #7d2e20;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14'%3E%3Cpath d='M0 14 L7 2 L14 14z' fill='%23f1e2c4'/%3E%3Cpath d='M14 0 L21 12 L28 0z' fill='%23231a14'/%3E%3Cpath d='M4 14 L7 9 L10 14z' fill='%23c08a2e'/%3E%3Cpath d='M18 0 L21 5 L24 0z' fill='%23f1e2c4'/%3E%3C/svg%3E");
  background-size: 28px 14px; background-repeat: repeat-x;
  border-top: 2px solid #231a14; border-bottom: 2px solid #231a14;
}
.sadu.thin { height: 10px; background-size: 20px 10px; border-width: 1px; border-radius: 3px; }

/* ───── التخطيط ───── */
.wrap { max-width: 880px; margin: 0 auto; padding: 20px 16px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.45rem; }
.page-head p { margin: 2px 0 0; color: var(--ink-2); font-size: .95rem; }
.section-title { font-family: var(--display); font-weight: 500; font-size: 1.05rem; color: var(--ink-2); margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 18px; }
.grid { display: grid; gap: 12px; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }

/* ───── بطاقات المهام ───── */
.task {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; position: relative; overflow: hidden;
  transition: transform .2s ease, opacity .3s ease;
}
.task::before { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 5px; background: var(--clay); }
.task.weekly::before { background: var(--palm); }
.task.done::before { background: var(--gold); }
.task-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; flex: none;
  background: var(--card-2); border: 1px solid var(--line);
}
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 800; font-size: 1.06rem; margin: 0; }
.task-desc { margin: 2px 0 6px; color: var(--ink-2); font-size: .9rem; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: .76rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--henna-soft); color: var(--henna); }
.chip.weekly { background: var(--palm-soft); color: var(--palm); }
.chip.pts { background: var(--gold-soft); color: var(--gold); }
.chip.off { background: var(--bg-2); color: var(--ink-2); }

.btn {
  border: 0; border-radius: 14px; padding: 11px 18px; font-weight: 800; background: var(--night); color: var(--sand-on-night);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .1s ease, filter .15s ease; white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--henna), var(--clay)); color: #fff8ec; }
.btn.gold { background: linear-gradient(135deg, #b7802a, #d9a54a); color: #2a1d0f; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: #c0452e; border: 1px solid currentColor; }
.btn.sm { padding: 7px 12px; font-size: .85rem; border-radius: 11px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-done {
  width: 54px; height: 54px; border-radius: 50%; border: 2px dashed var(--clay); background: transparent; color: var(--clay);
  display: grid; place-items: center; flex: none; transition: all .2s ease;
}
.btn-done:hover { background: var(--henna-soft); border-style: solid; }
.btn-done svg { width: 26px; height: 26px; }
.task.leaving { transform: translateX(-30px); opacity: 0; }

/* ───── الترحيب والتقدم ───── */
.hero { display: flex; align-items: center; gap: 18px; padding: 18px; margin-bottom: 16px; }
.hero h3 { margin: 0 0 4px; font-family: var(--display); font-weight: 500; font-size: 1.2rem; }
.hero p { margin: 0; color: var(--ink-2); }
.ring { position: relative; width: 96px; height: 96px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--bg-2); }
.ring .bar { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 1.35rem; }
.ring.lg { width: 132px; height: 132px; }
.ring.lg .val { font-size: 1.8rem; }
.bar-line { height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.bar-line > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--clay)); transition: width .6s ease; }

.empty { text-align: center; padding: 34px 18px; }
.empty .big { font-size: 2.6rem; }
.empty h3 { font-family: var(--display); font-weight: 500; margin: 6px 0 4px; }
.empty p { margin: 0; color: var(--ink-2); }

/* ───── الإحصاءات والترتيب ───── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 14px; text-align: center; }
.stat b { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.stat span { color: var(--ink-2); font-size: .82rem; }
.score-hero { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 18px; }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 12px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 9px; font-weight: 700; color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 10px; align-items: end; margin: 8px 0 14px; }
.pod { text-align: center; padding: 14px 8px 12px; border-radius: 18px 18px 10px 10px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.pod .medal { font-size: 1.8rem; }
.pod .nm { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod .pt { color: var(--gold); font-weight: 800; }
.pod.p1 { padding-top: 22px; background: linear-gradient(180deg, var(--gold-soft), var(--card)); border-color: var(--gold); }
.pod.me { outline: 2px solid var(--henna); }

.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.rank-row:first-child { border-top: 0; }
.rank-row.me { background: var(--henna-soft); }
.rank-no { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--bg-2); }
.rank-row .nm { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.rank-row .pct { font-size: .8rem; color: var(--ink-2); }
.rank-row .pts { font-weight: 800; color: var(--gold); text-align: left; }
.you { font-size: .7rem; background: var(--henna); color: #fff; padding: 1px 8px; border-radius: 999px; }

/* ───── السجل ───── */
.day-group { margin-bottom: 14px; }
.day-label { font-weight: 800; color: var(--ink-2); font-size: .9rem; margin: 0 4px 6px; }
.hist { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.hist:first-child { border-top: 0; }
.hist .ic { font-size: 1.3rem; }
.hist .t { flex: 1; font-weight: 700; }
.hist .tm { color: var(--ink-2); font-size: .8rem; }

/* ───── الإشعارات ───── */
.notif { padding: 14px 16px; border-top: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; gap: 12px; }
.notif:first-child { border-top: 0; }
.notif .dot { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); font-size: 1.1rem; }
.notif.alert .dot { background: var(--henna-soft); color: var(--henna); }
.notif h4 { margin: 0; font-size: 1rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.notif p { margin: 4px 0 0; color: var(--ink-2); white-space: pre-wrap; }
.notif .when { font-size: .78rem; color: var(--ink-2); font-weight: 500; }
.notif.new { background: linear-gradient(90deg, transparent, var(--gold-soft)); }
.new-tag { font-size: .68rem; background: var(--gold); color: #2a1d0f; padding: 0 7px; border-radius: 999px; }

/* ───── النماذج ───── */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: .92rem; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); background: var(--card-2); border-radius: 12px; padding: 11px 14px; outline: none; transition: border .15s, box-shadow .15s;
}
.input:focus { border-color: var(--clay); box-shadow: 0 0 0 3px color-mix(in srgb, var(--clay) 22%, transparent); }
textarea.input { min-height: 96px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.icons-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.icons-pick button { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); font-size: 1.2rem; }
.icons-pick button.on { border: 2px solid var(--henna); background: var(--henna-soft); }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio-cards label { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; gap: 8px; align-items: center; cursor: pointer; background: var(--card-2); font-weight: 700; }
.radio-cards input { accent-color: var(--henna); }
.radio-cards label:has(input:checked) { border-color: var(--henna); background: var(--henna-soft); }
.error { color: #c0452e; font-weight: 700; min-height: 1.4em; margin: 0 0 10px; font-size: .9rem; }

/* ───── لوحة المشرف ───── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
th { font-size: .8rem; color: var(--ink-2); font-weight: 700; border-top: 0; background: var(--card-2); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--card-2); }
.pct-cell { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.pct-cell .bar-line { flex: 1; }
.student-cards { display: none; }
.srow { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.srow:first-child { border-top: 0; }
.grid7 { display: grid; grid-template-columns: minmax(110px, 1.4fr) repeat(7, 1fr); gap: 4px; align-items: center; font-size: .85rem; }
.grid7 .h { text-align: center; color: var(--ink-2); font-size: .72rem; }
.grid7 .c { aspect-ratio: 1; border-radius: 8px; background: var(--bg-2); display: grid; place-items: center; }
.grid7 .c.y { background: var(--palm); color: #fff; }
.grid7 .tt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-task { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); }
.admin-task:first-child { border-top: 0; }
.admin-task.inactive { opacity: .55; }
.admin-task .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

/* ───── اللوح المنزلق ───── */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(15, 12, 8, .45); z-index: 40; animation: fade .2s; }
.sheet {
  position: fixed; z-index: 41; inset-inline: 0; bottom: 0; margin: 0 auto; max-width: 640px; max-height: 88vh; overflow: auto;
  background: var(--card); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.25); animation: up .25s ease;
  padding: 8px 0 calc(16px + env(safe-area-inset-bottom));
}
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 6px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 18px 10px; }
.sheet-head h3 { margin: 0; font-family: var(--display); font-weight: 500; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 20px); z-index: 60; opacity: 0; pointer-events: none;
  background: var(--night); color: var(--sand-on-night); padding: 11px 18px; border-radius: 14px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: all .25s ease; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.burst { position: fixed; pointer-events: none; z-index: 70; font-size: 1.1rem; animation: burst .9s ease-out forwards; }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) scale(.4); opacity: 0; } }

.quote { font-family: var(--quran); font-size: 1.15rem; text-align: center; color: var(--ink-2); padding: 16px 10px 4px; }

@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 10px 6px; }
  .stat b { font-size: 1.2rem; }
  .row, .cols { grid-template-columns: 1fr; }
  .score-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .table-wrap.desktop { display: none; }
  .student-cards { display: block; }
  .hero { padding: 14px; gap: 14px; }
  .ring { width: 80px; height: 80px; }
  .task { padding: 12px; gap: 12px; }
  .task-icon { width: 44px; height: 44px; font-size: 1.35rem; border-radius: 13px; }
  .admin-task { flex-wrap: wrap; }
  .admin-task .actions { width: 100%; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ───── الدخول بالبريد وطلبات الانضمام ───── */
.linkish { background: none; border: 0; padding: 0; color: var(--henna); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.notice-box { background: var(--palm-soft); color: var(--palm); border-radius: 14px; padding: 14px 16px; font-weight: 700; line-height: 1.8; }
.req-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.req-row:first-child { border-top: 0; }
.req-row .actions { display: flex; gap: 6px; }
.req-info { min-width: 0; }
.count-pill { background: var(--henna); color: #fff; font-family: var(--font); font-size: .75rem; font-weight: 800; padding: 0 9px; border-radius: 999px; }
.rejected-box { margin-top: 18px; }
.rejected-box summary { cursor: pointer; color: var(--ink-2); font-weight: 700; margin-bottom: 10px; }

/* ═════════ الإطار الجديد (على نمط صناعة القادة) ═════════ */
:root { --brand: #9c3f2a; --brand-dark: #7d2e20; --surface: #fffdf8; }
:root[data-theme="dark"] { --surface: #1f2736; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --surface: #1f2736; } }

/* صفحات الدخول: بطاقة في المنتصف فوق خلفية متدرجة من ليل البادية إلى الحنّاء */
.auth-shell {
  position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 16px; overflow: hidden;
  background: linear-gradient(180deg, #121826 0%, var(--night) 35%, #5a2a22 80%, var(--brand) 100%);
}
.auth-stars {
  position: absolute; inset: 0; pointer-events: none; opacity: .7;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 26%, #f7e7c4 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 52% 8%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 74% 20%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 90% 10%, #f7e7c4 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 36%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 86% 34%, #fff 50%, transparent 51%);
}
.auth-card {
  position: relative; width: 100%; max-width: 440px; background: var(--surface); border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.auth-inner { padding: 24px; }
@media (min-width: 640px) { .auth-inner { padding: 32px; } }
.auth-head { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; margin-bottom: 22px; }
.auth-head h1 { margin: 0; font-size: 1.3rem; font-weight: 800; color: var(--ink); }
.auth-head p { margin: 4px 0 0; font-size: .9rem; color: var(--ink-2); }
.auth-verse { position: relative; font-family: var(--quran); color: #f1dfbd; font-size: 1.15rem; margin: 22px 0 0; text-align: center; opacity: .9; }
.logo-img { border-radius: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.15); flex: none; display: block; }

.stack { display: grid; gap: 16px; }
.stack .field { margin: 0; }
.field label { font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.input { background: #fff; padding: 12px 16px; }
:root[data-theme="dark"] .input { background: var(--card-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .input { background: var(--card-2); } }
.input.ltr { text-align: left; }
.input.ltr::placeholder { text-align: left; }
.hint { margin: 2px 0 0; font-size: .78rem; color: var(--ink-2); opacity: .85; }
.center { text-align: center; }
.link { color: var(--brand); font-weight: 600; font-size: .9rem; text-decoration: none; }
.link:hover { text-decoration: underline; }
.link.strong { font-weight: 800; }
.alert { border-radius: 12px; padding: 10px 14px; font-size: .9rem; line-height: 1.8; }
.error-box { background: color-mix(in srgb, #d23b3b 10%, transparent); color: #c0392b; }
.success-box { background: var(--palm-soft); color: var(--palm); }
.big-emoji { font-size: 2.6rem; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); filter: none; }
.btn { padding: 12px 18px; border-radius: 12px; font-weight: 700; }

/* داخل التطبيق: شريط علوي أبيض ثابت + تبويبات */
.app-shell { position: relative; min-height: 100vh; }
.watermark { position: fixed; inset: 0; z-index: 0; pointer-events: none; display: grid; place-items: center; }
.watermark img { width: min(80vw, 560px); opacity: .05; }
.app-header, .nav-tabs, .app-shell main, .thin-band { position: relative; z-index: 1; }
.app-header {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
@media (min-width: 640px) { .app-header { padding: 10px 24px; } }
.hdr-side { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.logo-text { display: grid; line-height: 1.2; }
.logo-text b { font-family: var(--display); font-size: 1.3rem; font-weight: 700; color: var(--ink); }
.logo-text small { font-size: .72rem; color: var(--ink-2); }
.menu-wrap { position: relative; }
.menu-btn, .logout-btn, .bell-btn {
  position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--ink-2);
}
.menu-btn:hover, .logout-btn:hover, .bell-btn:hover { background: var(--bg-2); }
.logout-btn svg, .bell-btn svg { width: 18px; height: 18px; }
.dot-count { position: absolute; top: -5px; left: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #d23b3b; color: #fff; font-size: .68rem; font-weight: 800; display: grid; place-items: center; }
.menu-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 250px; max-width: 85vw; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px rgba(40, 25, 10, .18);
}
.menu-label { padding: 6px 12px; font-size: .75rem; font-weight: 800; color: var(--ink-2); opacity: .7; }
.menu-pop a, .menu-item {
  display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 10px 12px; border-radius: 10px; border: 0;
  background: transparent; text-decoration: none; color: var(--ink); font-size: .9rem; font-weight: 600; text-align: right;
}
.menu-pop a:hover, .menu-item:hover { background: var(--bg); }
.menu-pop a.on { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand); }
.menu-item.danger { color: #c0392b; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 0; }
.points-pill { display: none; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-size: .78rem; }
.points-pill b { font-size: .9rem; }
@media (min-width: 640px) { .points-pill { display: inline-flex; } }
.who { display: grid; line-height: 1.25; text-align: left; }
.who b { font-size: .88rem; }
.who small { font-size: .72rem; color: var(--ink-2); }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 800; flex: none; }
.thin-band { height: 8px; background-size: 16px 8px; border-width: 1px; }
.nav-tabs {
  display: flex; gap: 4px; overflow-x: auto; padding: 0 8px; background: var(--surface); border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }
@media (min-width: 640px) { .nav-tabs { padding: 0 16px; justify-content: center; } }
.nav-tabs a {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 12px 16px; font-size: .9rem; font-weight: 600;
  color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.nav-tabs a:hover { color: var(--ink); }
.nav-tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.tab-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: #fff; font-size: .7rem; font-weight: 800; display: inline-grid; place-items: center; }
.menu-pop .tab-count { margin-inline-start: auto; }
.profile-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-title { margin: 0 0 14px; font-size: 1.05rem; }
.card { background: color-mix(in srgb, var(--card) 94%, transparent); }
@media (max-width: 640px) {
  .who, .logo-text small { display: none; }
  .app-header { padding: 8px 12px; }
  .hdr-side { gap: 8px; }
}

/* ───── بطاقتا النسبة: نسبتي + النسبة العامة ───── */
.pct-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pct-cards.single { grid-template-columns: 1fr; }
.score-hero.group .ring .bar { stroke: var(--palm); }
.stats.two { grid-template-columns: repeat(2, 1fr); }
.rank-row .pts { font-size: 1.15rem; }
@media (max-width: 760px) { .pct-cards { grid-template-columns: 1fr; } }

/* ───── خيار إرسال تنبيه بالبريد ───── */
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); cursor: pointer; font-weight: 600; font-size: .92rem; }
.check-row input { accent-color: var(--brand); width: 18px; height: 18px; margin-top: 3px; flex: none; }
.check-row small { display: block; font-weight: 400; color: var(--ink-2); font-size: .8rem; margin-top: 2px; }
.check-row.off { opacity: .75; cursor: default; }

/* ───── بطاقة التذكير اليومي ───── */
.remind-state { margin: 0; font-weight: 700; color: var(--ink-2); }
.remind-state.on { color: var(--palm); }
