:root {
  --sy-green: #007A3D;
  --sy-green-dark: #064E3B;
  --sy-ivory: #F8FAF8;
  --sy-charcoal: #101820;
  --sy-red: #CE1126;
  --sy-gold: #C5A46D;
  --bg: #f3f7f4;
  --bg-elev: rgba(255, 255, 255, 0.72);
  --bg-solid: #ffffff;
  --text: #101820;
  --muted: #5b6b63;
  --line: rgba(6, 78, 59, 0.12);
  --shadow: 0 10px 40px rgba(16, 24, 32, 0.08);
  --radius: 18px;
  --sidebar: 280px;
  --font: "Cairo", "IBM Plex Sans Arabic", Tahoma, sans-serif;
  --ok: #0f8a4b;
  --warn: #b8860b;
  --danger: #c62828;
}

html.dark {
  --bg: #0c1411;
  --bg-elev: rgba(18, 32, 28, 0.82);
  --bg-solid: #12201c;
  --text: #f2f7f4;
  --muted: #9bb0a5;
  --line: rgba(197, 164, 109, 0.18);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(0, 122, 61, 0.16), transparent 55%),
    radial-gradient(900px 500px at -10% 20%, rgba(197, 164, 109, 0.14), transparent 50%),
    linear-gradient(165deg, #f8faf8 0%, #eef5f0 45%, #e7f1ea 100%);
  background-attachment: fixed;
}

html.dark body {
  background:
    radial-gradient(1000px 500px at 100% 0%, rgba(0, 122, 61, 0.22), transparent 55%),
    radial-gradient(800px 400px at 0% 30%, rgba(197, 164, 109, 0.1), transparent 50%),
    #0c1411;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.app {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}

.shell {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.main {
  padding: 1.25rem 1.5rem 3rem;
  max-width: 1280px;
}

.section { display: none; animation: fadeUp 0.35s ease; }
.section.is-active { display: block; }

.section__head { margin-bottom: 1.25rem; }
.section__head h2 { margin: 0 0 0.25rem; font-size: 1.55rem; }
.section__head p { margin: 0; color: var(--muted); }

.hint { color: var(--muted); font-size: 0.9rem; margin: 0.75rem 0 0; }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.35);
}

html.dark .empty { background: rgba(255,255,255,0.03); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Splash */
.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(0,122,61,0.25), transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(206,17,38,0.12), transparent 35%),
    #0f1f18;
  color: #fff;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.splash.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash.is-done {
  /* بعد الاختفاء لا يعيق الواجهة */
  display: none;
}
.splash__card { text-align: center; padding: 2rem; }
.splash__title { margin: 1rem 0 0.25rem; font-size: clamp(1.6rem, 4vw, 2.4rem); }
.splash__sub { margin: 0; color: var(--sy-gold); letter-spacing: 0.08em; }
.splash__bar {
  width: 180px; height: 3px; margin: 1.5rem auto 0;
  background: rgba(255,255,255,0.15); border-radius: 99px; overflow: hidden;
}
.splash__bar span {
  display: block; height: 100%; width: 40%;
  background: linear-gradient(90deg, var(--sy-green), var(--sy-gold));
  animation: splashLoad 1.2s ease infinite;
}

.brand-mark {
  display: inline-flex; gap: 0.35rem; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--sy-green), var(--sy-green-dark));
  color: #fff; border-radius: 14px; padding: 0.55rem 0.7rem;
  box-shadow: 0 8px 24px rgba(0,122,61,0.35);
  border: 1px solid rgba(197,164,109,0.35);
}
.brand-mark--lg { padding: 1rem 1.2rem; border-radius: 20px; }
.brand-mark .star {
  width: 8px; height: 8px; background: var(--sy-red);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.brand-mark--lg .star { width: 14px; height: 14px; }

/* Sidebar */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  padding: 1.25rem 1rem;
  background: var(--bg-elev);
  backdrop-filter: blur(18px);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 1rem;
  z-index: 40;
}
.sidebar__brand {
  display: flex; gap: 0.75rem; align-items: center; padding: 0.25rem 0.35rem 1rem;
  border-bottom: 1px solid var(--line);
}
.sidebar__brand strong { display: block; font-size: 0.98rem; }
.sidebar__brand small { color: var(--muted); }
.sidebar__nav { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.sidebar__foot { margin-top: auto; }

.nav-item {
  display: flex; align-items: center; gap: 0.7rem;
  border: 0; background: transparent; text-align: right;
  padding: 0.75rem 0.85rem; border-radius: 12px; cursor: pointer;
  color: var(--muted); transition: 0.2s ease;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { background: rgba(0,122,61,0.08); color: var(--text); }
.nav-item.is-active {
  background: linear-gradient(120deg, rgba(0,122,61,0.16), rgba(197,164,109,0.12));
  color: var(--sy-green-dark);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(0,122,61,0.15);
}
html.dark .nav-item.is-active { color: #d7efe3; }

.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.5rem;
  position: sticky; top: 0; z-index: 30;
  background: rgba(248,250,248,0.75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
html.dark .topbar { background: rgba(12,20,17,0.8); }
.topbar__titles { flex: 1; min-width: 0; }
.topbar__titles h1 { margin: 0; font-size: 1.15rem; }
.topbar__titles p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.88rem; }
.topbar__actions { display: flex; gap: 0.5rem; align-items: center; }
#menuBtn { display: none; }

.backdrop {
  position: fixed; inset: 0; background: rgba(16,24,32,0.45); z-index: 35;
}

/* Scrollbar */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: rgba(0,122,61,0.35); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box;
}
*::-webkit-scrollbar-track { background: transparent; }
