.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--navy);
  color: #eef4fa;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
[data-theme="dark"] .sidebar { background: #0a1018; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(145deg, #3ddc97, #0f6e56);
  display: grid; place-items: center;
  font-weight: 700; color: #073226; letter-spacing: -0.04em;
  box-shadow: 0 6px 16px rgba(13, 90, 70, 0.35);
}
.brand h1 { font-size: 1rem; color: #fff; }
.brand small { display: block; color: rgba(255,255,255,0.62); font-weight: 400; font-size: 0.72rem; }
.nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-section { margin: 14px 12px 6px; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.45); }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; color: rgba(255,255,255,0.82);
  text-decoration: none; font-size: 0.92rem;
}
.nav a:hover { background: rgba(255,255,255,0.08); }
.nav a.active { background: rgba(61, 220, 151, 0.16); color: #fff; }
.nav .ico { width: 18px; text-align: center; opacity: 0.9; }
.sidebar-foot {
  margin-top: auto; padding: 14px 16px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.8rem; color: rgba(255,255,255,0.65);
}
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #3ddc97; color: #073226; display: grid; place-items: center;
  font-weight: 700; font-size: 0.78rem;
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; position: sticky; top: 0; z-index: 20;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.crumb { color: var(--muted); font-size: 0.88rem; }
.content { padding: 22px; max-width: 1440px; width: 100%; margin: 0 auto; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-105%); transition: transform 0.2s var(--ease); }
  html[dir="rtl"] .sidebar { inset: 0 0 0 auto; transform: translateX(105%); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex !important; }
}
.menu-btn { display: none; }

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: var(--bg);
}
.login-hero {
  background:
    radial-gradient(800px 400px at 20% 20%, rgba(61,220,151,0.18), transparent 50%),
    linear-gradient(160deg, #0d2238 0%, #16324f 55%, #0f6e56 140%);
  color: #fff;
  padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-hero h2 { font-size: 2.1rem; max-width: 18ch; line-height: 1.2; margin-top: 28px; }
.login-hero p { max-width: 46ch; color: rgba(255,255,255,0.78); margin-top: 14px; }
.login-panel { display: grid; place-items: center; padding: 32px; }
.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}
@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { min-height: 240px; padding: 28px; }
  .login-panel { padding-bottom: 96px; }
}
