/* ruslab layout — topbar, sidebars, drawers, page shells */

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--rus-bg) 80%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--rus-border);
}
.topbar > .topbar-brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: inherit;
}
.topbar > .topbar-spacer { flex: 1; }
.topbar > .topbar-right {
  display: flex; align-items: center; gap: 10px;
}
.topbar-balance {
  background: rgba(52, 211, 153, .14);
  color: var(--rus-accent);
  padding: 5px 10px;
  border-radius: 999px;
  font: 600 13px/1 var(--rus-font-sans);
}

/* ---------- Sidebar (cabinet + admin) ---------- */
.shell-with-sidebar {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 56px);
}
.shell-sidebar {
  background: var(--rus-bg-elev);
  border-right: 1px solid var(--rus-border);
  padding: 24px 16px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}
.shell-sidebar h4.nav-title {
  font: 600 11px/16px var(--rus-font-sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rus-fg-faint);
  padding: 0 12px;
  margin: 16px 0 8px;
}
.shell-sidebar h4.nav-title:first-child { margin-top: 0; }

.shell-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  margin: 0; padding: 0;
}
.shell-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px 9px 14px;
  border-radius: 8px;
  color: var(--rus-fg-mute);
  text-decoration: none;
  font: 500 14px/1 var(--rus-font-sans);
  transition: background var(--rus-t-fast) var(--rus-ease),
              color var(--rus-t-fast) var(--rus-ease);
}
.shell-nav a:hover { background: var(--rus-bg-soft); color: var(--rus-fg); }
.shell-nav a.active {
  background: rgba(52, 211, 153, .10);
  color: var(--rus-accent);
}
.shell-nav a.active::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--rus-grad);
}
.shell-nav .nav-icon {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.shell-nav .nav-badge {
  margin-left: auto;
  background: var(--rus-bg-soft);
  color: var(--rus-fg-mute);
  font: 600 11px/1 var(--rus-font-sans);
  padding: 3px 7px;
  border-radius: 999px;
}
.shell-nav a.active .nav-badge { background: rgba(52, 211, 153, .18); color: var(--rus-accent); }

/* ---------- Main column ---------- */
.shell-main {
  padding: 40px 32px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}
.shell-main > h1 { margin-bottom: 6px; }
.shell-main > .lead { margin-bottom: 32px; }

/* ---------- Mobile drawer ---------- */
.shell-drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 60;
  display: none;
}
.shell-drawer-backdrop[data-open="true"] { display: block; }

.shell-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 280px;
  max-width: 84vw;
  background: var(--rus-bg-elev);
  border-right: 1px solid var(--rus-border);
  z-index: 61;
  padding: 20px 16px;
  transform: translateX(-100%);
  transition: transform var(--rus-t-base) var(--rus-ease-out);
}
.shell-drawer[data-open="true"] { transform: translateX(0); }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .shell-with-sidebar { grid-template-columns: 1fr; }
  .shell-sidebar { display: none; }
  .shell-main { padding: 24px 16px; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar-balance { display: none; }
  .shell-main { padding: 20px 14px; }
  h1.t-h1 { font-size: 24px; }
}

/* ---------- Bottom tab bar (mobile cabinet) ---------- */
.bottom-tabs {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 55;
  background: var(--rus-bg-elev);
  border-top: 1px solid var(--rus-border);
  display: none;
  padding: 8px 0 calc(env(safe-area-inset-bottom, 0));
}
.bottom-tabs ul {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0; padding: 0;
  list-style: none;
}
.bottom-tabs a {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
  padding: 6px 4px;
  color: var(--rus-fg-mute);
  font: 600 11px/1 var(--rus-font-sans);
  text-decoration: none;
}
.bottom-tabs a.active { color: var(--rus-accent); }
.bottom-tabs .bt-icon { font-size: 20px; line-height: 1; }

@media (max-width: 767px) {
  .bottom-tabs { display: block; }
  body.has-bottom-tabs { padding-bottom: 72px; }
}

/* ---------- Footer ---------- */
.rus-footer {
  padding: 32px 24px;
  border-top: 1px solid var(--rus-border);
  color: var(--rus-fg-faint);
  font: 500 13px/1.4 var(--rus-font-sans);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}

/* ---------- Page enter animation ---------- */
.fade-up { animation: fade-up var(--rus-t-slow) var(--rus-ease-out) both; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stagger > * { animation: fade-up var(--rus-t-slow) var(--rus-ease-out) both; }
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 40ms; }
.stagger > *:nth-child(3) { animation-delay: 80ms; }
.stagger > *:nth-child(4) { animation-delay: 120ms; }
.stagger > *:nth-child(5) { animation-delay: 160ms; }
.stagger > *:nth-child(6) { animation-delay: 200ms; }

/* ---------- Utility ---------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.text-center { text-align: center; }
.hidden { display: none; }
