/* =========================================================
   يومياتي - يوميات طلاب العراق
   تصميم جديد بالكامل — خفيف، RTL، ومتجاوب مع الهاتف أولاً
   ========================================================= */

@font-face { font-family: "Cairo"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/cairo-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/cairo-arabic-700-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 800; font-display: swap; src: url(../fonts/cairo-arabic-800-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/cairo-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/cairo-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 800; font-display: swap; src: url(../fonts/cairo-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --brand: #2f5bea;
  --brand-d: #1e40c8;
  --brand-soft: #e8eeff;
  --purple: #7c3aed;
  --red: #e0313a;
  --green: #16a34a;
  --orange: #f08c00;
  --pink: #db2777;
  --grad: linear-gradient(115deg, #e0313a 0%, #8b3fd9 48%, #2f5bea 100%);
  --grad-soft: linear-gradient(135deg, #eef2ff 0%, #f5efff 55%, #fff1f2 100%);

  --bg: #f4f7ff;
  --surface: #ffffff;
  --surface-2: #f1f4fd;
  --surface-3: #e9eefb;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --border: #e3e8f4;
  --ring: rgba(47, 91, 234, .28);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 24px rgba(30, 64, 175, .07);
  --shadow-lg: 0 12px 40px rgba(30, 64, 175, .16);
  --paper-line: #e8edf9;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --side-w: 264px;
  --top-h: 64px;
  --bn-h: 68px;
  --font: "Cairo", "Segoe UI", Tahoma, system-ui, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --brand: #6f8dff;
  --brand-d: #5877f5;
  --brand-soft: #1b2650;
  --grad-soft: linear-gradient(135deg, #151e3b 0%, #1d1737 55%, #2a1522 100%);
  --bg: #0b1020;
  --surface: #121a2e;
  --surface-2: #18223a;
  --surface-3: #1f2b47;
  --text: #e8ecf7;
  --text-2: #c3cbe0;
  --muted: #8e9ab6;
  --border: #25314f;
  --ring: rgba(111, 141, 255, .35);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .45);
  --paper-line: #1f2a45;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.7;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .5em; font-weight: 800; }
p { margin: 0 0 .75em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; top: -60px; inset-inline-start: 12px; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { top: 12px; }
.ic { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
.muted { color: var(--muted); }
.small, small { font-size: .85rem; }
.center { text-align: center; }
.pad { padding: 18px 8px; margin: 0; }
.pad-t { padding-top: 14px; }
.grow { flex: 1 1 auto; }
.inline { display: inline; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--surface-3); padding: 2px 8px; border-radius: 6px; font-weight: 700; letter-spacing: 1px; }
.h2 { font-size: 1.35rem; }
.h3 { font-size: 1.1rem; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- أزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 20px; border-radius: 14px; border: 1.5px solid transparent;
  font-weight: 700; font-size: .98rem; line-height: 1.2; white-space: nowrap;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, color .2s;
  text-decoration: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(47, 91, 234, .25); }
.btn-primary:hover { background: var(--brand-d); }
.btn-grad { background: var(--grad); background-size: 140% 100%; color: #fff; box-shadow: 0 8px 22px rgba(124, 58, 237, .28); }
.btn-grad:hover { background-position: 100% 0; box-shadow: 0 10px 28px rgba(124, 58, 237, .38); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { filter: brightness(.97); }
.btn-light { background: #fff; color: #1e3a8a; box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-soft { background: rgba(224, 49, 58, .1); color: var(--red); }
.btn-sm { min-height: 36px; padding: 5px 14px; font-size: .88rem; border-radius: 11px; }
.btn-lg { min-height: 52px; padding: 10px 28px; font-size: 1.05rem; border-radius: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 700; font-size: .92rem; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--red); }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  border: 0; background: transparent; color: var(--text-2); transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; }
.icon-btn.sm .ic { width: 17px; height: 17px; }
.icon-btn.filled { background: var(--brand); color: #fff; }
.icon-btn[disabled] { opacity: .3; pointer-events: none; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- الشارات والرقائق ---------- */
.badge { display: inline-flex; align-items: center; padding: 1px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge-blue { background: var(--brand-soft); color: var(--brand); }
.badge-green { background: rgba(22, 163, 74, .12); color: #15803d; }
.badge-red { background: rgba(224, 49, 58, .12); color: #c81e2a; }
.badge-orange { background: rgba(240, 140, 0, .14); color: #b45309; }
.badge-gray { background: var(--surface-3); color: var(--muted); }
:root[data-theme="dark"] .badge-green { color: #4ade80; }
:root[data-theme="dark"] .badge-red { color: #fb7185; }
:root[data-theme="dark"] .badge-orange { color: #fbbf24; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); font-size: .85rem; font-weight: 600; }
.chip .ic { width: 15px; height: 15px; }
.chip-grad { background: var(--grad); color: #fff; }
.chip-pink { background: rgba(219, 39, 119, .1); color: var(--pink); }
.chip-blue { background: var(--brand-soft); color: var(--brand); }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chip-f {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 6px 14px; border-radius: 99px;
  background: var(--surface); border: 1.5px solid var(--border); color: var(--text-2); font-weight: 700; font-size: .9rem; white-space: nowrap;
}
.chip-f b { font-size: .75rem; background: var(--surface-2); color: var(--muted); padding: 0 7px; border-radius: 99px; }
.chip-f.sm { padding: 4px 12px; font-size: .84rem; }
.chip-f.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-f.is-on b { background: rgba(255, 255, 255, .22); color: #fff; }

/* ---------- التنبيهات ---------- */
.flashes { display: grid; gap: 10px; margin-bottom: 16px; }
.pub-top + .flashes { max-width: 560px; margin: 12px auto 0; padding: 0 16px; }
.alert { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; padding-inline-end: 40px; border-radius: 14px; font-weight: 600; font-size: .95rem; border: 1px solid transparent; margin-bottom: 12px; }
.flashes .alert { margin: 0; }
.alert .ic { margin-top: 3px; }
.alert-success { background: rgba(22, 163, 74, .1); color: #166534; border-color: rgba(22, 163, 74, .2); }
.alert-error { background: rgba(224, 49, 58, .09); color: #b91c1c; border-color: rgba(224, 49, 58, .2); }
.alert-info { background: var(--brand-soft); color: var(--brand-d); border-color: rgba(47, 91, 234, .18); }
.alert-warning { background: rgba(240, 140, 0, .1); color: #92400e; border-color: rgba(240, 140, 0, .25); }
:root[data-theme="dark"] .alert-success { color: #86efac; }
:root[data-theme="dark"] .alert-error { color: #fda4af; }
:root[data-theme="dark"] .alert-info { color: #b4c4ff; }
:root[data-theme="dark"] .alert-warning { color: #fcd34d; }
.alert-x { position: absolute; inset-inline-end: 8px; top: 6px; border: 0; background: none; font-size: 1.4rem; line-height: 1; color: inherit; opacity: .6; padding: 4px 8px; }
.alert.big { font-size: 1.05rem; display: block; }
.announce { text-decoration: none; }

/* ---------- الحقول ---------- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 700; font-size: .92rem; color: var(--text-2); }
.field em, legend em { font-style: normal; font-weight: 500; color: var(--muted); font-size: .82rem; }
.field small, .hint { color: var(--muted); font-size: .8rem; }
.hint.ok { color: var(--green); }
.hint.bad { color: var(--red); }
input[type="text"], input:not([type]), input[type="search"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 13px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 1rem; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 14px center; padding-left: 36px; }
textarea { resize: vertical; line-height: 1.8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
input:disabled { background: var(--surface-2); color: var(--muted); }
input[type="date"], input[type="time"] { min-width: 0; }
.input-ic { position: relative; display: flex; align-items: center; }
.input-ic > .ic { position: absolute; inset-inline-start: 13px; color: var(--muted); width: 19px; height: 19px; pointer-events: none; }
.input-ic input { padding-inline-start: 42px; }
.input-ic .pw-eye + * { display: none; }
.pw-eye { position: absolute; inset-inline-end: 6px; border: 0; background: none; color: var(--muted); padding: 8px; border-radius: 10px; }
.input-ic:has(.pw-eye) input { padding-inline-end: 44px; }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: .95rem; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.note { background: var(--surface-2); border-radius: 12px; padding: 10px 14px; font-size: .9rem; color: var(--text-2); margin: 0; }
.grid-2, .grid-3 { display: grid; gap: 14px; grid-template-columns: 1fr; }
.row-gap { display: flex; gap: 10px; align-items: center; }
.row-gap.wrap, .toolbar.wrap { flex-wrap: wrap; }
.w-sm { width: 140px; }
.w-md { width: 180px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; font-size: .92rem; color: var(--text-2); margin-bottom: 8px; padding: 0; }
.sec-title { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; }

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .span-2 { grid-column: span 2; }
  .span-3 { grid-column: 1 / -1; }
}

/* ---------- الهوية ---------- */
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand img { border-radius: 50%; }
.brand span { display: grid; line-height: 1.2; }
.brand strong { font-size: 1.2rem; font-weight: 800; }
.brand small { color: var(--muted); font-size: .76rem; font-weight: 600; }

/* =========================================================
   هيكل التطبيق
   ========================================================= */
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side-w); z-index: 60;
  background: var(--surface); border-inline-end: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 14px; padding: 18px 14px; overflow-y: auto;
  transform: translateX(105%); transition: transform .25s ease; visibility: hidden;
}
body.nav-open .sidebar { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
.scrim { position: fixed; inset: 0; background: rgba(8, 12, 30, .45); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }
body.nav-open .scrim { opacity: 1; pointer-events: auto; }
.side-nav { display: grid; gap: 2px; }
.side-nav a, .side-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; color: var(--text-2);
  font-weight: 700; font-size: .96rem; border: 0; background: none; width: 100%; text-align: start;
}
.side-nav a:hover, .side-link:hover { background: var(--surface-2); }
.side-nav a.is-active { background: var(--brand-soft); color: var(--brand); }
.side-nav a.is-active .ic { color: var(--brand); }
.side-nav .ic { color: var(--muted); }
.nav-badge { margin-inline-start: auto; background: var(--red); color: #fff; font-size: .72rem; padding: 0 8px; border-radius: 99px; }
.side-logout { margin-top: auto; }
.side-link { color: var(--muted); }
.side-foot { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); padding: 8px 14px; }
.side-foot img { border-radius: 50%; }
.side-write { margin-block: 4px; }

.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--top-h); display: flex; align-items: center; gap: 8px;
  padding: 0 12px; padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.topbar-title { font-size: 1.15rem; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.topbar-user { display: block; border-radius: 50%; }
.main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px 14px calc(var(--bn-h) + 28px + env(safe-area-inset-bottom)); flex: 1; }

.ic-sun { display: none; }
:root[data-theme="dark"] .ic-sun { display: block; }
:root[data-theme="dark"] .ic-moon { display: none; }

/* شريط التنقل السفلي (الهاتف) */
.bottom-nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 50; height: calc(var(--bn-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border); box-shadow: 0 -6px 24px rgba(15, 23, 42, .06);
}
.bn-item { display: grid; justify-items: center; gap: 2px; color: var(--muted); font-size: .72rem; font-weight: 700; background: none; border: 0; padding: 6px 0; -webkit-tap-highlight-color: transparent; }
.bn-item .ic { width: 23px; height: 23px; }
.bn-item.is-active { color: var(--brand); }
.bn-fab { display: grid; place-items: center; width: 54px; height: 54px; margin-top: -30px; border-radius: 18px; background: var(--grad); color: #fff; box-shadow: 0 10px 24px rgba(124, 58, 237, .4); border: 4px solid var(--bg); }
.bn-fab .ic { width: 26px; height: 26px; }
.bn-write { color: var(--text-2); }

@media (min-width: 1024px) {
  .sidebar { transform: none; visibility: visible; }
  .scrim, .bottom-nav, .only-mobile { display: none !important; }
  .shell { margin-inline-start: var(--side-w); }
  .main { padding: 24px 28px 48px; }
  .topbar { padding: 0 28px; }
}

/* ---------- البطاقات ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { font-size: 1.05rem; margin: 0; display: flex; align-items: center; gap: 8px; }
.card-head h2 .ic { color: var(--brand); }
.card-head h2 small { color: var(--muted); font-weight: 600; }
.dash-grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 0; }
.dash-grid > .card { margin-bottom: 0; }
.dash-grid + .card, .dash-grid + .dash-grid, .card + .dash-grid, .stats + .dash-grid { margin-top: 16px; }
.dash-grid + .card { margin-top: 16px; }
@media (min-width: 720px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
  .dash-grid:not(.two):not(.wide-side):not(.three) { grid-template-columns: repeat(2, 1fr); }
  .dash-grid.three { grid-template-columns: repeat(3, 1fr); }
  .dash-grid.wide-side { grid-template-columns: 2fr 1fr; }
}
.mini-title { font-size: .92rem; color: var(--text-2); margin: 16px 0 8px; }
.bullet-list, .plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bullet-list li { background: var(--surface-2); padding: 8px 12px; border-radius: 12px; font-weight: 600; font-size: .95rem; }
.bullet-list li.is-done { text-decoration: line-through; color: var(--muted); }
.plain-list li { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.plain-list li:last-child { border: 0; }

.empty { text-align: center; padding: 34px 16px; }
.empty-emoji { font-size: 3rem; line-height: 1; margin-bottom: 10px; }
.empty h3 { font-size: 1.15rem; margin-bottom: 4px; }
.empty p { color: var(--muted); }

/* ---------- الصور الشخصية ---------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; flex: 0 0 auto; background: var(--surface-3); }
.avatar-sm { width: 36px; height: 36px; }
.avatar-lg { width: 70px; height: 70px; }
.avatar-xl { width: 116px; height: 116px; }
.avatar-letter { background: linear-gradient(135deg, hsl(var(--h) 75% 55%), hsl(calc(var(--h) + 40) 75% 50%)); color: #fff; font-weight: 800; font-size: 1.05rem; }
.avatar-lg.avatar-letter { font-size: 1.8rem; }
.avatar-xl.avatar-letter { font-size: 3rem; }

/* =========================================================
   الصفحة الرئيسية للطالب
   ========================================================= */
.welcome { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--grad); color: #fff; margin-bottom: 16px; box-shadow: var(--shadow-lg); }
.welcome::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 12% 120%, rgba(255, 255, 255, .22), transparent 45%), radial-gradient(circle at 90% -30%, rgba(255, 255, 255, .18), transparent 40%); pointer-events: none; }
.welcome-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .28; mix-blend-mode: luminosity; }
.welcome-in { position: relative; z-index: 1; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 20px; }
.welcome-avatar .avatar { border: 3px solid rgba(255, 255, 255, .85); box-shadow: 0 6px 18px rgba(0, 0, 0, .15); }
.welcome-text small { opacity: .9; font-weight: 600; }
.welcome-text h2 { font-size: 1.35rem; margin: 2px 0 4px; }
.welcome-text p { margin: 0; opacity: .95; font-size: .95rem; }
.welcome-btn { grid-column: 1 / -1; justify-self: stretch; }
@media (min-width: 720px) {
  .welcome-in { grid-template-columns: auto 1fr auto; padding: 26px 28px; }
  .welcome-btn { grid-column: auto; justify-self: end; }
  .welcome-text h2 { font-size: 1.6rem; }
}

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; color: var(--text); text-decoration: none; transition: transform .15s; }
a.stat:hover { transform: translateY(-2px); }
.stat strong { font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.stat small { grid-column: 2; color: var(--muted); font-weight: 600; font-size: .82rem; }
.stat em { grid-column: 1 / -1; font-style: normal; font-size: .76rem; color: var(--muted); margin-top: 6px; border-top: 1px dashed var(--border); padding-top: 6px; }
.stat-ic { grid-row: span 2; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.s-blue { background: var(--brand-soft); color: var(--brand); }
.s-orange { background: rgba(240, 140, 0, .13); color: var(--orange); }
.s-green { background: rgba(22, 163, 74, .12); color: var(--green); }
.s-purple { background: rgba(124, 58, 237, .12); color: var(--purple); }
.s-pink { background: rgba(219, 39, 119, .11); color: var(--pink); }
.s-red { background: rgba(224, 49, 58, .11); color: var(--red); }
.admin-stats { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .admin-stats { grid-template-columns: repeat(5, 1fr); } }

.mini-sched { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mini-sched li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border-inline-start: 4px solid var(--c); }
.ms-n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--c); color: #fff; font-size: .8rem; font-weight: 800; }
.ms-sub { font-weight: 700; flex: 1; }
.ms-time { color: var(--muted); font-size: .85rem; direction: ltr; }
.add-inline { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-weight: 700; font-size: .9rem; }
.add-inline .ic { width: 17px; height: 17px; }

.next-rem { display: flex; gap: 14px; align-items: center; background: var(--grad-soft); border-radius: 16px; padding: 14px; }
.nr-emoji { font-size: 2rem; }
.next-rem strong { font-size: 1.05rem; }
.next-rem p { margin: 0; color: var(--text-2); font-size: .9rem; }
.countdown { color: var(--brand); font-weight: 800; }
.prompt-card { background: var(--grad-soft); }
.prompt-text { font-size: 1.15rem; font-weight: 700; color: var(--text); margin: 4px 0 14px; }

/* ---------- المهام ---------- */
.task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.task { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; transition: opacity .2s; }
.task-list.compact .task { background: var(--surface-2); border: 0; padding: 10px 12px; }
.task-toggle { margin: 0; }
.tick { width: 28px; height: 28px; border-radius: 9px; border: 2px solid color-mix(in srgb, var(--muted) 60%, transparent); background: var(--surface); display: grid; place-items: center; color: transparent; padding: 0; transition: all .15s; flex: 0 0 auto; }
.tick .ic { width: 17px; height: 17px; stroke-width: 3; }
.tick:hover { border-color: var(--green); }
.is-done .tick, .tick[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 700; word-break: break-word; }
.is-done .task-title, .goal.is-done .g-text { text-decoration: line-through; color: var(--muted); }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 4px; font-size: .8rem; color: var(--muted); }
.task-due { display: inline-flex; align-items: center; gap: 4px; }
.task-due .ic { width: 14px; height: 14px; }
.task-due.late { color: var(--red); font-weight: 700; }
.task-desc { font-size: .88rem; color: var(--text-2); margin-top: 6px; }
.is-overdue { border-color: rgba(224, 49, 58, .35); }
.task-edit { flex: 0 0 auto; }
.tag { padding: 1px 9px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); font-weight: 700; }
.tag-exam { background: rgba(224, 49, 58, .1); color: var(--red); }
.tag-homework { background: var(--brand-soft); color: var(--brand); }
.tag-reminder { background: rgba(240, 140, 0, .13); color: #b45309; }
.tag-study { background: rgba(124, 58, 237, .1); color: var(--purple); }
.tag-goal { background: rgba(22, 163, 74, .1); color: var(--green); }
.task-group { margin-bottom: 20px; }
.group-title { font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.group-title small { background: var(--surface-3); color: var(--muted); border-radius: 99px; padding: 0 9px; font-size: .78rem; }
.task-form-card { padding: 0; overflow: hidden; }
.task-form-card > summary { list-style: none; margin: 0; width: 100%; border-radius: 0; min-height: 52px; }
.task-form-card > summary::-webkit-details-marker { display: none; }
.task-form-card[open] > summary { border-radius: 0; }
.task-form-card > form { padding: 18px; }
.type-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.type-pick legend { width: 100%; }
.tp input { position: absolute; opacity: 0; }
.tp span { display: inline-flex; padding: 7px 14px; border-radius: 12px; background: var(--surface-2); border: 1.5px solid var(--border); font-weight: 700; font-size: .9rem; cursor: pointer; transition: all .15s; }
.tp input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.tp input:focus-visible + span { box-shadow: 0 0 0 4px var(--ring); }
.type-filter { margin-bottom: 12px; }

/* ---------- التبويبات ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 12px; color: var(--text-2); font-weight: 700; font-size: .92rem; white-space: nowrap; }
.tab .ic { width: 17px; height: 17px; }
.tab b { font-size: .74rem; background: var(--surface-3); color: var(--muted); padding: 0 7px; border-radius: 99px; }
.tab.is-on { background: var(--brand); color: #fff; }
.tab.is-on b { background: rgba(255, 255, 255, .25); color: #fff; }

/* ---------- بطاقات اليوميات ---------- */
.d-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .d-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .d-grid { grid-template-columns: repeat(3, 1fr); } }
.d-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; display: flex; flex-direction: column; }
.d-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.d-link { position: absolute; inset: 0; z-index: 2; }
.d-cover { position: relative; aspect-ratio: 4 / 3; background: var(--surface-3); overflow: hidden; }
.d-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.d-imgs { position: absolute; bottom: 8px; inset-inline-start: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; display: inline-flex; align-items: center; gap: 4px; }
.d-imgs .ic { width: 13px; height: 13px; }
.d-body { padding: 14px 16px 16px; display: grid; gap: 4px; }
.d-card:not(.has-cover) .d-body { border-top: 5px solid transparent; border-image: var(--grad) 1; }
.d-meta { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.d-mood { font-size: 1.1rem; }
.d-fav { color: #f5b301; margin-inline-start: auto; }
.d-title { font-size: 1.05rem; margin: 0; }
.d-excerpt { color: var(--text-2); font-size: .9rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- الأرشيف ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar h2 { margin: 0; font-size: 1.15rem; }
.search { position: relative; flex: 1; display: flex; align-items: center; min-width: 180px; }
.search > .ic { position: absolute; inset-inline-start: 14px; color: var(--muted); pointer-events: none; }
.search input { padding-inline-start: 44px; border-radius: 14px; }
.seg { display: inline-flex; background: var(--surface); border: 1.5px solid var(--border); border-radius: 13px; padding: 3px; }
.seg a { display: grid; place-items: center; width: 38px; height: 36px; border-radius: 10px; color: var(--muted); }
.seg a.is-on { background: var(--brand-soft); color: var(--brand); }
.hide-sm { display: none; }
@media (min-width: 560px) { .hide-sm { display: inline; } }
.archive-bar { display: grid; gap: 2px; margin-bottom: 8px; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 8px 0 12px; }
.list-head h2 { font-size: 1.15rem; margin: 0; }
.list-head small { color: var(--muted); font-weight: 600; }

.month-cal { padding: 14px; }
.mc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mc-head strong { font-size: 1.05rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-dn { font-size: .72rem; color: var(--muted); font-weight: 700; padding: 4px 0; }
.cal-d { position: relative; display: grid; place-items: center; aspect-ratio: 1; max-height: 58px; border-radius: 12px; color: var(--text-2); font-weight: 700; font-size: .9rem; }
.cal-d:hover { background: var(--surface-2); }
.cal-d.has { background: var(--brand-soft); color: var(--brand); }
.cal-d.is-today { box-shadow: inset 0 0 0 2px var(--brand); }
.cal-d.is-sel { background: var(--brand); color: #fff; }
.dots { position: absolute; bottom: 5px; display: flex; gap: 2px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.dots i.dot-exam { background: var(--red); }
.dots i.dot-reminder { background: var(--orange); }
.dots i.dot-study { background: var(--purple); }
.dots i.done { opacity: .35; }
.cal-d.is-sel .dots i { background: #fff; }
.tasks-cal .cal-d { background: transparent; }
.tasks-cal .cal-d.has { background: var(--surface-2); color: var(--text); }
.tasks-cal .cal-d.is-sel { background: var(--brand); color: #fff; }

.timeline { position: relative; padding-inline-start: 26px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 13px; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: var(--grad); opacity: .35; }
.tl-month { margin: 8px 0 12px; }
.tl-month span { display: inline-block; background: var(--grad); color: #fff; padding: 3px 14px; border-radius: 99px; font-weight: 800; font-size: .85rem; margin-inline-start: -26px; }
.tl-item { position: relative; margin-bottom: 12px; }
.tl-dot { position: absolute; inset-inline-start: -30px; top: 14px; width: 30px; height: 30px; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border); border-radius: 50%; font-size: 1rem; z-index: 1; }
.tl-card { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px; color: var(--text); box-shadow: var(--shadow); margin-inline-start: 12px; transition: transform .15s; }
.tl-card:hover { transform: translateX(-3px); }
.tl-card img { width: 86px; height: 86px; object-fit: cover; border-radius: 12px; flex: 0 0 auto; }
.tl-card small { color: var(--muted); font-weight: 600; }
.tl-card h3 { font-size: 1rem; margin: 0 0 2px; }
.tl-card p { margin: 0; color: var(--text-2); font-size: .88rem; }

.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 22px 0; }
.pager-btn { min-width: 42px; height: 42px; padding: 0 12px; display: inline-grid; place-items: center; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-weight: 700; }
.pager-btn.is-current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* =========================================================
   محرّر اليوميات
   ========================================================= */
.editor { max-width: 860px; margin: 0 auto; }
.paper {
  background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); border: 1px solid var(--border);
  padding: 18px; margin-bottom: 16px; position: relative; overflow: hidden;
}
.paper::before { content: ""; position: absolute; top: 0; inset-inline: 0; height: 6px; background: var(--grad); }
.paper-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 14px; }
.date-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 12px; padding: 0 10px; color: var(--brand); }
.date-pill input { border: 0; background: transparent; min-height: 40px; padding: 6px 4px; width: auto; font-weight: 700; color: var(--text); }
.date-pill input:focus { box-shadow: none; }
.fav-toggle input { position: absolute; opacity: 0; }
.fav-toggle span, .fav-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); font-size: 1.4rem; color: var(--muted); cursor: pointer; transition: all .15s; border: 0; }
.fav-toggle input:checked + span, .fav-btn.is-on { background: #fff4d6; color: #f5b301; transform: scale(1.05); }
:root[data-theme="dark"] .fav-toggle input:checked + span, :root[data-theme="dark"] .fav-btn.is-on { background: #3a3015; }
.fav-toggle input:focus-visible + span { box-shadow: 0 0 0 4px var(--ring); }
.moods legend { margin-bottom: 6px; }
.mood-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.mood-row::-webkit-scrollbar { display: none; }
.mood { flex: 0 0 auto; }
.mood input { position: absolute; opacity: 0; }
.mood span { display: grid; justify-items: center; width: 62px; padding: 6px 0 4px; border-radius: 14px; border: 1.5px solid transparent; background: var(--surface-2); cursor: pointer; transition: all .15s; }
.mood b { font-size: 1.6rem; line-height: 1.2; font-weight: 400; transition: transform .15s; }
.mood small { font-size: .7rem; color: var(--muted); font-weight: 700; }
.mood input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.mood input:checked + span b { transform: scale(1.18); }
.mood input:focus-visible + span { box-shadow: 0 0 0 4px var(--ring); }
.title-input { border: 0 !important; box-shadow: none !important; background: transparent !important; font-size: 1.45rem; font-weight: 800; padding: 12px 2px !important; min-height: auto; }
.content-input {
  border: 0 !important; box-shadow: none !important; padding: 0 2px !important; min-height: 260px; resize: none; font-size: 1.08rem; line-height: 2.2rem;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(2.2rem - 1px), var(--paper-line) calc(2.2rem - 1px), var(--paper-line) 2.2rem) !important;
  background-attachment: local !important;
}
.paper-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; font-weight: 600; margin-top: 8px; }
.extras summary, .danger-zone > summary { cursor: pointer; font-weight: 800; display: flex; align-items: center; gap: 8px; list-style: none; }
.extras summary::-webkit-details-marker, .danger-zone > summary::-webkit-details-marker { display: none; }
.extras summary em { font-style: normal; color: var(--muted); font-weight: 600; font-size: .85rem; }
.extras summary .ic { color: var(--purple); }
.extras[open] summary { margin-bottom: 14px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 640px) { .photo-grid { grid-template-columns: repeat(5, 1fr); } }
.ph, .ph-add { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-cover, .ph-del { position: absolute; top: 6px; }
.ph-cover { inset-inline-start: 6px; }
.ph-del { inset-inline-end: 6px; }
.ph-cover input, .ph-del input { position: absolute; opacity: 0; }
.ph-cover span, .ph-del span, .ph-x { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(0, 0, 0, .5); color: #fff; cursor: pointer; font-size: 1rem; border: 0; }
.ph-del span .ic { width: 16px; height: 16px; }
.ph-cover input:checked + span { background: #f5b301; }
.ph-del input:checked + span { background: var(--red); }
.ph:has(.ph-del input:checked) img { opacity: .35; filter: grayscale(1); }
.ph-x { position: absolute; top: 6px; inset-inline-end: 6px; }
.ph.is-new::after { content: "جديدة"; position: absolute; bottom: 6px; inset-inline-start: 6px; background: var(--brand); color: #fff; font-size: .68rem; font-weight: 800; padding: 1px 8px; border-radius: 99px; }
.ph-add { display: grid; place-items: center; align-content: center; gap: 2px; border: 2px dashed color-mix(in srgb, var(--brand) 45%, transparent); background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .82rem; cursor: pointer; }
.ph-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ph-add .ic { width: 26px; height: 26px; }
.editor-actions {
  position: sticky; bottom: calc(var(--bn-h) + 10px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; justify-content: space-between; gap: 10px; padding: 10px; border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.editor-actions .btn-grad { flex: 1; max-width: 320px; }
@media (min-width: 1024px) { .editor-actions { bottom: 16px; } }

/* =========================================================
   قراءة اليومية
   ========================================================= */
.read { max-width: 820px; margin: 0 auto; }
.read-cover { border-radius: 24px 24px 0 0; overflow: hidden; max-height: 420px; }
.read-cover img { width: 100%; height: 100%; max-height: 420px; object-fit: cover; display: block; }
.read-cover + .read-paper { border-radius: 0 0 24px 24px; border-top: 0; }
.read-paper { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 22px 20px; box-shadow: var(--shadow); }
.read-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.read-meta form { margin-inline-start: auto; }
.read-title { font-size: 1.7rem; }
.read-content { font-size: 1.1rem; line-height: 2.1; color: var(--text); word-wrap: break-word; }
.read-extras { display: grid; gap: 10px; margin: 20px 0 6px; }
@media (min-width: 640px) { .read-extras { grid-template-columns: 1fr 1fr; } }
.rx { display: flex; gap: 12px; background: var(--grad-soft); border-radius: 16px; padding: 12px 14px; }
.rx > span { font-size: 1.5rem; }
.rx small { color: var(--muted); font-weight: 700; }
.rx p { margin: 0; font-weight: 600; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 18px; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.g-item { display: block; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.g-item:hover img { transform: scale(1.04); }
.read-stamp { font-size: .8rem; margin: 18px 0 0; }
.read-actions { display: flex; gap: 10px; justify-content: center; margin: 16px 0; }
.read-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rn { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 10px 12px; color: var(--text); font-weight: 700; font-size: .9rem; min-width: 0; }
.rn span { display: grid; min-width: 0; }
.rn small { color: var(--muted); font-weight: 600; }
.rn-prev { justify-content: flex-end; text-align: end; grid-column: 2; }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(5, 8, 20, .92); display: grid; place-items: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 12px; }
.lb-x { position: absolute; top: 12px; inset-inline-end: 12px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .15); color: #fff; font-size: 1.8rem; }

/* =========================================================
   الجدول الدراسي
   ========================================================= */
.day-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(74px, 1fr); gap: 6px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; scrollbar-width: none; }
.day-tabs::-webkit-scrollbar { display: none; }
.dt { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--border); color: var(--text-2); font-weight: 700; font-size: .88rem; }
.dt b { font-size: .75rem; background: var(--surface-2); color: var(--muted); border-radius: 99px; padding: 0 8px; }
.dt.is-today { border-color: color-mix(in srgb, var(--brand) 50%, transparent); }
.dt.is-on { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 8px 20px rgba(124, 58, 237, .25); }
.dt.is-on b { background: rgba(255, 255, 255, .25); color: #fff; }
.sched-layout { display: grid; gap: 16px; }
.sched-layout > .card { margin: 0; }
@media (min-width: 1000px) { .sched-layout { grid-template-columns: 1.5fr 1fr; align-items: start; } }
.sched-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.sl-item { background: var(--surface-2); border-radius: 16px; border-inline-start: 5px solid var(--c); overflow: hidden; }
.sl-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.sl-n { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--c); color: #fff; font-weight: 800; flex: 0 0 auto; }
.sl-main { flex: 1; min-width: 0; display: grid; }
.sl-main strong { font-size: 1.02rem; }
.sl-main small { color: var(--muted); display: flex; align-items: center; gap: 4px; }
.sl-main small .ic { width: 14px; height: 14px; }
.sl-actions { display: flex; gap: 2px; }
.sl-actions form { margin: 0; }
.sl-edit { padding: 12px; border-top: 1px solid var(--border); background: var(--surface); }
.add-sched { border-top: 1px dashed var(--border); padding-top: 16px; }
.add-sched h3 { font-size: 1rem; display: flex; align-items: center; gap: 6px; margin: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw input { position: absolute; opacity: 0; }
.sw span { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--c); cursor: pointer; border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--border); transition: transform .12s; }
.sw input:checked + span { box-shadow: 0 0 0 3px var(--c); transform: scale(1.1); }
.sw input:focus-visible + span { outline: 3px solid var(--ring); }
.week { display: grid; gap: 6px; }
.wk-day { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; color: var(--text); }
.wk-day:hover, .wk-day.is-on { background: var(--surface-2); }
.wk-day strong { font-size: .9rem; }
.wk-subs { display: flex; flex-wrap: wrap; gap: 4px; }
.wk-subs i { font-style: normal; font-size: .76rem; font-weight: 700; padding: 1px 8px; border-radius: 8px; background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); }
.copy-day { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 14px; }

/* =========================================================
   الأهداف
   ========================================================= */
.goals-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--grad-soft); border-radius: var(--r-lg); padding: 20px; margin-bottom: 16px; border: 1px solid var(--border); }
.goals-hero h2 { font-size: 1.35rem; margin-bottom: 4px; }
.goals-hero p { margin: 0; color: var(--text-2); }
.ring { --p: 0; width: 96px; height: 96px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; align-content: center; background: radial-gradient(closest-side, var(--surface) 76%, transparent 78% 100%), conic-gradient(var(--brand) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring span { font-weight: 800; font-size: 1.3rem; line-height: 1; }
.ring small { font-size: .62rem; color: var(--muted); font-weight: 700; }
.goal-grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .goal-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .goal-grid { grid-template-columns: repeat(3, 1fr); } }
.goal-card { margin: 0; display: flex; flex-direction: column; }
.goal-card.is-focus { box-shadow: 0 0 0 3px var(--ring), var(--shadow); }
.g-em { font-size: 1.3rem; }
.goal-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.goal { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; }
.goal:hover { background: var(--surface-2); }
.goal form { margin: 0; }
.g-bullet { font-size: 1.05rem; }
.g-text { flex: 1; font-weight: 600; word-break: break-word; }
.g-menu { position: relative; }
.g-menu > summary { list-style: none; }
.g-menu > summary::-webkit-details-marker { display: none; }
.g-pop { position: absolute; inset-inline-end: 0; top: 38px; z-index: 20; width: min(300px, 80vw); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 12px; }
.goal-add { display: flex; gap: 8px; margin-top: auto; }
.goal-add input { min-height: 42px; }
.more-cats { margin-top: 24px; }
.more-cats h3 { font-size: 1rem; color: var(--text-2); }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 14px; background: var(--surface); border: 1.5px dashed var(--border); color: var(--text-2); font-weight: 700; font-size: .92rem; }
.cat-chip .ic { width: 16px; height: 16px; color: var(--brand); }
.cat-chip:hover { border-color: var(--brand); color: var(--brand); }

/* =========================================================
   الملف الشخصي
   ========================================================= */
.profile-card { background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px; }
.pc-cover { position: relative; height: 150px; background: var(--grad); }
.pc-cover[data-empty]::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 20% 130%, rgba(255, 255, 255, .3), transparent 50%), radial-gradient(circle at 85% -20%, rgba(255, 255, 255, .25), transparent 45%); }
.pc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-edit { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 1; }
@media (min-width: 720px) { .pc-cover { height: 220px; } }
.pc-body { text-align: center; padding: 0 16px 20px; }
.pc-avatar { margin-top: -60px; position: relative; display: inline-block; }
.pc-avatar .avatar { border: 5px solid var(--surface); box-shadow: var(--shadow); }
.pc-body h2 { font-size: 1.45rem; margin: 6px 0 0; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pc-user { color: var(--muted); margin: 0; font-weight: 600; }
.pc-sub { color: var(--text-2); font-weight: 700; margin: 4px 0 0; }
.pc-bio { max-width: 560px; margin: 10px auto 0; color: var(--text-2); }
.pc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 560px; margin: 16px auto 0; }
.pc-stats div { background: var(--surface-2); border-radius: 14px; padding: 10px 4px; display: grid; }
.pc-stats strong { font-size: 1.25rem; font-weight: 800; }
.pc-stats small { color: var(--muted); font-size: .74rem; font-weight: 700; }
.info-list { margin: 0; display: grid; gap: 2px; }
.info-list div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.info-list div:last-child { border: 0; }
.info-list dt { color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.info-list dt .ic { width: 16px; height: 16px; }
.info-list dd { margin: 0; font-weight: 700; text-align: end; }
.dream { font-size: 1.15rem; background: var(--grad-soft); padding: 12px 16px; border-radius: 14px; }

/* الإعدادات */
.photo-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.photo-edit form { margin: 0; }
.cover-preview { height: 130px; border-radius: 16px; overflow: hidden; background: var(--grad); margin-bottom: 12px; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.narrow-card { max-width: 520px; }
.danger-zone { border-color: rgba(224, 49, 58, .3); }
details.danger-zone { margin-top: 18px; border: 1px solid rgba(224, 49, 58, .3); border-radius: 14px; padding: 12px; }
details.danger-zone > summary { color: var(--red); }
details.danger-zone[open] > summary { margin-bottom: 12px; }

/* =========================================================
   الدعم الفني
   ========================================================= */
.ticket-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ticket-list a { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; color: var(--text); }
.ticket-list a.unread { border-inline-start: 4px solid var(--brand); }
.tk-main { flex: 1; display: grid; min-width: 0; }
.tk-main small { color: var(--muted); }
.thread { display: grid; gap: 12px; margin-bottom: 16px; }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 18px; }
.msg-user { background: var(--brand-soft); justify-self: start; border-end-start-radius: 6px; }
.msg-admin { background: var(--surface-2); justify-self: end; border-end-end-radius: 6px; border: 1px solid var(--border); }
.msg-who { font-size: .8rem; font-weight: 800; color: var(--text-2); margin-bottom: 4px; }
.msg-body { word-wrap: break-word; }
.reply-form { border-top: 1px dashed var(--border); padding-top: 14px; }
.support-guest { max-width: 640px; margin: 0 auto; padding: 24px 16px 40px; }
.form-card { max-width: 680px; margin-inline: auto; }
.big-emoji { font-size: 2.6rem; }
.track-card { margin-top: 16px; }

/* =========================================================
   الصفحات العامة
   ========================================================= */
.public { background: var(--bg); }
.pub-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; max-width: 1180px; margin: 0 auto; }
.pub-nav { display: flex; align-items: center; gap: 8px; }
.pub-foot { background: var(--surface); border-top: 1px solid var(--border); margin-top: 40px; }
.pub-foot-in { max-width: 1180px; margin: 0 auto; padding: 24px 16px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.pub-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; }
.pub-foot nav a { color: var(--text-2); font-weight: 600; font-size: .92rem; }
.pub-foot small { color: var(--muted); }
.foot-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
.foot-brand img { border-radius: 50%; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 760px; }

.auth-page { background: var(--bg) var(--grad-soft); background-image: radial-gradient(circle at 10% 0%, rgba(47, 91, 234, .12), transparent 40%), radial-gradient(circle at 100% 100%, rgba(224, 49, 58, .08), transparent 40%); min-height: 100vh; }
.auth-wrap { display: grid; place-items: center; padding: 16px 16px 40px; }
.auth-card { width: 100%; max-width: 460px; background: var(--surface); border-radius: 26px; padding: 26px 20px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.auth-card.wide { max-width: 720px; }
.auth-head { text-align: center; margin-bottom: 18px; }
.auth-head img { border-radius: 50%; box-shadow: 0 8px 26px rgba(47, 91, 234, .25); margin-bottom: 6px; }
.auth-head h1 { font-size: 1.5rem; margin: 6px 0 2px; }
.auth-head p { color: var(--muted); margin: 0; }
.auth-foot { text-align: center; margin-top: 16px; font-size: .92rem; }
.auth-foot p { margin: 4px 0; }
.auth-foot a { font-weight: 700; }
.check-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }
.check-list li { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-weight: 600; font-size: .92rem; }
.check-list li::before { margin-inline-end: 8px; }
.check-list .ok::before { content: "✅"; }
.check-list .bad::before { content: "❌"; }
.check-list .warn::before { content: "⚠️"; }

/* الصفحة الرئيسية العامة */
.hero { padding: 20px 0 30px; overflow: hidden; }
.hero-in { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .hero-in { grid-template-columns: 1.1fr 1fr; padding-top: 30px; } }
.hero h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); line-height: 1.25; margin: 14px 0 12px; }
.lead { font-size: 1.12rem; color: var(--text-2); max-width: 560px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 14px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--text-2); font-weight: 600; font-size: .92rem; }
.hero-points li { display: inline-flex; align-items: center; gap: 6px; }
.hero-points .ic { color: var(--green); width: 18px; height: 18px; }
.hero-art { position: relative; min-height: 340px; display: grid; place-items: center; }
.map-bg { position: absolute; width: min(420px, 90%); aspect-ratio: 1; border-radius: 42% 58% 55% 45% / 45% 40% 60% 55%; background: var(--grad); opacity: .14; filter: blur(2px); animation: float 9s ease-in-out infinite; }
.hero-logo { position: relative; width: 170px; height: 170px; border-radius: 50%; box-shadow: 0 20px 50px rgba(47, 91, 234, .3); z-index: 1; }
.mock-card { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 12px 14px; font-size: .85rem; z-index: 2; }
.mock-1 { width: 220px; top: 8px; inset-inline-start: 0; animation: float 7s ease-in-out infinite; }
.mock-1 strong { display: block; font-size: .98rem; }
.mock-1 p { margin: 2px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.6; }
.mock-top { display: flex; align-items: center; justify-content: space-between; }
.mock-mood { font-size: 1.3rem; }
.mock-date { color: var(--muted); font-size: .74rem; font-weight: 700; }
.mock-2 { bottom: 20px; inset-inline-end: 0; display: grid; gap: 6px; animation: float 8s ease-in-out infinite reverse; }
.mock-task { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.mock-check { width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--muted); }
.mock-task.done { color: var(--muted); text-decoration: line-through; }
.mock-task.done .mock-check { background: var(--green); border-color: var(--green); }
.mock-3 { bottom: 40px; inset-inline-start: 10px; display: flex; align-items: center; gap: 6px; font-weight: 800; color: var(--orange); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.section { padding: 44px 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-title { text-align: center; font-size: clamp(1.4rem, 4vw, 2rem); margin-bottom: 6px; }
.section-sub { text-align: center; color: var(--muted); max-width: 620px; margin: 0 auto 26px; }
.features { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(4, 1fr); } }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.feature-ic { width: 52px; height: 52px; border-radius: 16px; background: var(--grad-soft); display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 10px; }
.feature h3 { font-size: 1.08rem; margin-bottom: 4px; }
.feature p { color: var(--text-2); font-size: .93rem; margin: 0; }
.steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { text-align: center; padding: 20px; background: var(--bg); border-radius: 20px; }
.steps span { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; font-size: 1.2rem; margin-bottom: 8px; }
.steps h3 { font-size: 1.1rem; margin-bottom: 2px; }
.steps p { color: var(--muted); margin: 0; }
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 18px; }
.faq summary { cursor: pointer; font-weight: 800; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--brand); line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 10px 0 0; color: var(--text-2); }
.cta-band { display: grid; gap: 16px; justify-items: center; text-align: center; background: var(--grad); color: #fff; border-radius: 26px; padding: 30px 20px; box-shadow: var(--shadow-lg); }
.cta-band img { border-radius: 50%; border: 3px solid rgba(255, 255, 255, .7); }
.cta-band h2 { margin: 0; font-size: 1.5rem; }
.cta-band p { margin: 0; opacity: .95; }
@media (min-width: 800px) { .cta-band { grid-template-columns: auto 1fr auto; text-align: start; justify-items: start; padding: 30px 36px; } }

/* =========================================================
   الإدارة
   ========================================================= */
.bar-chart { width: 100%; height: auto; display: block; }
.bar-chart .bar { fill: var(--brand); transition: fill .15s; }
.bar-chart .hit { fill: transparent; }
.bar-chart .bar-g:hover .bar { fill: var(--purple); }
.bar-chart .bar-g:hover .hit { fill: color-mix(in srgb, var(--brand) 7%, transparent); }
.bar-chart .grid { stroke: var(--border); stroke-dasharray: 3 4; }
.bar-chart .axis { stroke: var(--border); stroke-width: 1.5; }
.bar-chart .tick { fill: var(--muted); font-size: 11px; text-anchor: middle; font-family: var(--font); }
.bar-chart .tick.max { text-anchor: end; }
.hbars { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.hbars li { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 10px; font-size: .88rem; }
.hb-l { font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hb-track i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.hb-v { font-weight: 800; min-width: 28px; text-align: end; }
.people { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.people li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px dashed var(--border); }
.people li:last-child { border: 0; }
.people a, .people .grow { flex: 1; min-width: 0; display: grid; color: var(--text); font-weight: 700; font-size: .92rem; }
.people small { color: var(--muted); font-weight: 500; }
.rank { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: 0 0 auto; }
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 720px; }
.table th { text-align: start; padding: 12px 14px; background: var(--surface-2); color: var(--muted); font-size: .8rem; white-space: nowrap; }
.table td { padding: 10px 14px; border-top: 1px solid var(--border); }
.table tr:hover td { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.user-cell { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.user-cell span { display: grid; }
.user-cell small { color: var(--muted); font-weight: 500; }
.log-list { list-style: none; padding: 0; margin: 0; max-height: 420px; overflow-y: auto; }
.log-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.admin-profile .pc-cover { height: 120px; }

/* ---------- الإعلانات ---------- */
.ad-box { position: relative; display: block; text-align: center; margin: 18px auto; max-width: 100%; overflow: hidden; }
.ad-responsive { min-height: 110px; }
.ad-fixed { min-height: 100px; }
.ad-label { display: block; font-size: .68rem; color: var(--muted); margin-bottom: 4px; letter-spacing: .5px; }
.ad-box ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.ad-box:has(ins[data-ad-status="unfilled"]) { display: none; }
.dash-grid + .ad-box, .card + .ad-box { margin-top: 0; }
.section .ad-box { padding: 0 16px; }

/* ---------- صفحة الخطأ ---------- */
.page-error { min-height: 100vh; display: grid; place-items: center; background: var(--bg); padding: 16px; }
.error-box { text-align: center; max-width: 440px; }
.error-code { font-size: 5rem; font-weight: 800; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-box p { color: var(--muted); }

/* ---------- الإشعارات المنبثقة ---------- */
.toast-wrap { position: fixed; inset-inline: 0; bottom: calc(var(--bn-h) + 18px + env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 8px; z-index: 95; pointer-events: none; padding: 0 16px; }
@media (min-width: 1024px) { .toast-wrap { bottom: 24px; } }
.toast { pointer-events: auto; background: #111827; color: #fff; padding: 10px 18px; border-radius: 14px; font-weight: 700; font-size: .92rem; box-shadow: var(--shadow-lg); animation: toastIn .25s ease; max-width: 520px; }
.toast.error { background: #b91c1c; }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- الطباعة ---------- */
@media print {
  .sidebar, .topbar, .bottom-nav, .read-actions, .read-nav, .editor-actions, .toast-wrap { display: none !important; }
  .shell { margin: 0 !important; }
  .card, .read-paper { box-shadow: none; border: 0; }
}
