.app { min-height: 100vh; }
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  background:
    radial-gradient(ellipse at top right, rgba(47,107,255,0.08), transparent 45%),
    radial-gradient(ellipse at bottom left, rgba(255,92,138,0.06), transparent 40%),
    var(--bg);
}

.topbar {
  grid-area: topbar;
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px;
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.brand {
  display: flex; align-items: center; gap: 10px; font-weight: 800;
  color: var(--text); letter-spacing: 0.02em; min-width: 0;
  cursor: pointer;
}
.brand-name { font-size: 1.05rem; }
.menu-toggle, .drawer-toggle {
  display: none;
  width: var(--touch); height: var(--touch);
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); cursor: pointer;
  align-items: center; justify-content: center; font-size: 1.25rem;
}
.topbar-search { flex: 1; max-width: 420px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.sidebar {
  grid-area: sidebar;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.sidebar-section {
  margin-top: 10px; padding: 0 10px 6px;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 8px 12px;
  border-radius: 12px; border: none; background: transparent;
  color: var(--text); cursor: pointer; text-align: left; width: 100%;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: var(--primary-soft); }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item img, .nav-item .nav-ico {
  width: 40px; height: 40px; border-radius: 12px; object-fit: contain;
  flex-shrink: 0; background: transparent;
  box-shadow: 0 2px 8px rgba(26, 35, 50, 0.08);
}
.nav-item.active .nav-ico {
  background: rgba(255,255,255,0.18);
  box-shadow: none;
}
.nav-label { font-weight: 600; font-size: 0.95rem; }

.main {
  grid-area: main;
  padding: 20px;
  overflow: auto;
  min-width: 0;
  padding-bottom: 28px;
}

.bottom-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: var(--bottom-nav-h);
  background: rgba(255,255,255,0.95);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
  padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
  justify-content: flex-start; align-items: center;
  gap: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.bottom-nav::-webkit-scrollbar { display: none; }
.bottom-nav button {
  flex: 0 0 auto; border: none; background: transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 0.6rem; font-weight: 700; min-height: 60px; cursor: pointer;
  padding: 4px 8px; min-width: 64px; max-width: 76px;
}
.bottom-nav button span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
  line-height: 1.1;
}
.bottom-nav button.active { color: var(--primary); }
.bottom-nav img {
  width: 30px; height: 30px; border-radius: 9px;
  object-fit: contain; flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(26, 35, 50, 0.1);
}

.drawer-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(26,35,50,0.35); z-index: 45;
}
.mobile-drawer {
  display: none; position: fixed; top: 0; left: 0; bottom: 0; width: min(86vw, 320px);
  background: var(--surface); z-index: 50; padding: 16px 12px; overflow-y: auto;
  transform: translateX(-105%); transition: transform 0.22s ease;
  box-shadow: var(--shadow);
}
.mobile-drawer.open { transform: translateX(0); }
body.drawer-open .drawer-backdrop { display: block; }
body.drawer-open .mobile-drawer { display: block; }

.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, #e8f0ff, transparent 42%),
    radial-gradient(circle at 85% 10%, #ffe8ef, transparent 38%),
    linear-gradient(180deg, #f7f9fc, #eef3fb);
}
.login-card {
  width: min(100%, 420px); background: var(--surface); border-radius: 20px;
  box-shadow: var(--shadow); padding: 28px 24px; border: 1px solid var(--border);
}
.login-card h1 { margin: 8px 0 4px; font-size: 1.6rem; }
.login-card .sub { color: var(--muted); margin: 0 0 20px; }
.lp-footer-link {
  background: none; border: 0; padding: 0; font: inherit; color: var(--primary);
  font-weight: 600; cursor: pointer;
}
.lp-footer-link:hover { text-decoration: underline; }

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "topbar" "main";
  }
  .sidebar { display: none; }
  .menu-toggle, .drawer-toggle { display: inline-flex; }
  .mobile-drawer { display: block; }
  .main { padding: 14px 12px calc(var(--bottom-nav-h) + 18px); }
  .bottom-nav { display: flex; }
  .brand-name { font-size: 0.95rem; }
  .topbar-search { max-width: none; }
}
