/* layout.css — هيكل اللوحة: شريط جانبي يمين (RTL) + المحتوى */

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

/* الشريط الجانبي — على اليمين في RTL */
.sidebar {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-inline-start: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 26px 22px;
  z-index: 60;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.brand__logo {
  width: 46px; height: 46px;
  flex: 0 0 auto;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-deep));
  display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(16,185,129,.35);
}
.brand__logo svg { width: 26px; height: 26px; }
.brand__name { font-weight: 800; font-size: 1.15rem; color: #fff; line-height: 1.2; }
.brand__tag { font-size: .72rem; color: var(--text-dim); letter-spacing: .02em; }

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.nav__label {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-dim); margin: 16px 8px 8px;
}
.nav__link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-weight: 600; font-size: .96rem;
  position: relative;
  transition: background var(--t), color var(--t), transform var(--t);
}
.nav__link svg { width: 19px; height: 19px; flex: 0 0 auto; opacity: .85; }
.nav__link:hover { background: rgba(16,185,129,.10); color: #fff; transform: translateX(-3px); }
.nav__link.is-active {
  background: linear-gradient(90deg, rgba(16,185,129,.20), rgba(16,185,129,.05));
  color: #fff;
}
.nav__link.is-active::before {
  content: ""; position: absolute; right: -22px; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 26px; border-radius: 4px;
  background: var(--emerald-2);
}

.sidebar__foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: .78rem;
  color: var(--text-dim);
}
.sidebar__foot a { color: var(--text-soft); }

/* المحتوى */
.main { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 14px clamp(16px, 3vw, 34px);
  background: rgba(11,20,17,.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar__title { font-weight: 700; font-size: 1rem; color: var(--text); }
.topbar__spacer { flex: 1; }
.topbar__meta {
  display: flex; align-items: center; gap: 10px;
  font-size: .82rem; color: var(--text-dim);
}
.topbar__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald-2); box-shadow: 0 0 0 4px rgba(16,185,129,.18); }

.burger {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 11px;
  cursor: pointer;
  align-items: center; justify-content: center;
}
.burger span, .burger span::before, .burger span::after {
  content: ""; display: block; width: 20px; height: 2px;
  background: var(--text); border-radius: 2px; transition: var(--t);
}
.burger span::before { transform: translateY(-6px); }
.burger span::after { transform: translateY(4px); }

.content { padding: clamp(22px, 3.4vw, 48px) clamp(16px, 3vw, 34px) 60px; flex: 1; }

.section { margin-bottom: clamp(40px, 6vw, 72px); }

.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding: 46px clamp(16px, 3vw, 34px) 30px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 36px;
  max-width: var(--maxw);
  margin-inline: auto;
}
.footer__brand { font-weight: 800; font-size: 1.15rem; color: #fff; margin-bottom: 10px; }
.footer h4 { margin-bottom: 14px; color: var(--text); font-size: .92rem; letter-spacing: .04em; }
.footer ul li { margin-bottom: 9px; }
.footer a { color: var(--text-soft); font-size: .92rem; }
.footer a:hover { color: var(--emerald-2); }
.footer__bottom {
  max-width: var(--maxw); margin: 34px auto 0;
  padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: .82rem; color: var(--text-dim);
}

/* الشاشة الخلفية للقائمة الجوال */
.scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  opacity: 0; visibility: hidden; transition: var(--t); z-index: 55;
}
.scrim.is-open { opacity: 1; visibility: visible; }

/* الاستجابة */
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 290px; max-width: 84vw;
    transform: translateX(105%);
    transition: transform var(--t);
    box-shadow: var(--shadow);
  }
  .sidebar.is-open { transform: translateX(0); }
  .main { grid-column: 1; }
  .burger { display: flex; }
  .nav__link.is-active::before { right: -10px; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .footer__grid { grid-template-columns: 1fr; gap: 26px; }
  .topbar__meta { display: none; }
}
