/* ═══════════════ App shell ═══════════════ */
.shell { display: flex; min-height: 100dvh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(178deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: var(--tx-on-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  z-index: 60;
  transition: transform var(--med);
}
.sidebar-head {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  flex-shrink: 0;
}
/* Official brand wordmark (SVG, mint mark + white type) */
.sidebar-head .brand-logo {
  height: 26px;
  width: auto;
  object-fit: contain;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 12px 20px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); }

.nav-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  color: rgba(255,255,255,.38);
  padding: 16px 10px 6px;
  text-transform: uppercase;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--r);
  color: rgba(255,255,255,.72);
  font-size: 13.5px;
  font-weight: 500;
  text-align: start;
  transition: background var(--fast), color var(--fast);
  position: relative;
}
.nav-item i { width: 17px; font-size: 14px; text-align: center; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active {
  background: rgba(0,255,145,.13);
  color: #fff;
  font-weight: 600;
}
.nav-item.active i { color: var(--accent-mint); }
.nav-item.active::before {
  content: '';
  position: absolute;
  inset-inline-start: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent-mint);
  border-radius: 0 3px 3px 0;
}
.nav-badge {
  margin-inline-start: auto;
  background: var(--accent-mint);
  color: var(--brand-deep);
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 700;
  min-width: 19px;
  height: 19px;
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
  padding: 0 5px;
}
.nav-badge.muted { background: rgba(255,255,255,.16); color: #fff; }

.sidebar-foot {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.09);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r);
  width: 100%;
  transition: background var(--fast);
}
.sidebar-user:hover { background: rgba(255,255,255,.08); }
.sidebar-user .meta { min-width: 0; text-align: start; }
.sidebar-user .meta b { display: block; font-size: 13px; font-weight: 600; }
.sidebar-user .meta small { font-size: 11px; color: rgba(255,255,255,.5); }

/* ── Main column ── */
.main {
  flex: 1;
  min-width: 0;
  margin-inline-start: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar h1 { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.topbar p { font-size: 12px; color: var(--tx-3); margin-top: -2px; }

.icon-btn {
  width: 37px; height: 37px;
  border-radius: var(--r);
  display: grid; place-items: center;
  color: var(--tx-3);
  font-size: 15px;
  transition: background var(--fast), color var(--fast);
  position: relative;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--tx-1); }
.icon-btn .dot {
  position: absolute; top: 7px; inset-inline-end: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--surface);
}
.menu-btn { display: none; }

/* Language switch */
.lang-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--tx-2);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  transition: all var(--fast);
  white-space: nowrap;
}
.lang-btn:hover { border-color: var(--accent); color: var(--brand); background: var(--accent-faint); }

.page { padding: 22px; flex: 1; }
.page-inner { max-width: 1240px; margin: 0 auto; }

/* ── Mobile bottom tab bar ── */
.tabbar {
  display: none;
  position: fixed;
  bottom: 0; inset-inline: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  z-index: 50;
}
.tabbar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--tx-4);
  font-size: 10px;
  font-weight: 600;
  transition: color var(--fast);
}
.tabbar button i { font-size: 17px; }
.tabbar button.active { color: var(--accent); }

.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,48,47,.42);
  backdrop-filter: blur(2px);
  z-index: 55;
  animation: fade .2s ease both;
}

/* ═══════════════ Responsive ═══════════════ */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(100%); box-shadow: var(--sh-4); }
  html[dir="ltr"] .sidebar { transform: translateX(-100%); }
  /* Both selectors are needed: `html[dir="ltr"] .sidebar` scores higher
     than a bare `.sidebar.open`, so in English the panel would stay
     parked off-canvas and the menu button did nothing. */
  .sidebar.open,
  html[dir="ltr"] .sidebar.open { transform: none; }
  .sidebar-scrim.show { display: block; }
  .main { margin-inline-start: 0; }
  .menu-btn { display: grid; }
}

@media (max-width: 768px) {
  .page { padding: 14px; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); }
  .topbar { padding: 0 14px; }
  .topbar h1 { font-size: 15px; }
  .tabbar { display: flex; }
}
