/* Sayt qobig'i: yon panel (kompyuter), pastki menyu (telefon), sahifa sarlavhasi. */
.shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100dvh;
}

/* ---- Yon panel: har ikki rejimda to'q yashil, kirish sahifasi va bot banneri bilan bir uslubda ---- */
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100dvh;
  padding: 20px 14px 14px;
  overflow: hidden;
  background: #062a21;
  color: rgba(234, 255, 246, 0.74);
  isolation: isolate;
}

.sidebar::before,
.sidebar::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.sidebar::before {
  background:
    radial-gradient(120% 40% at 100% 0%, rgba(52, 211, 153, 0.3), transparent 70%),
    radial-gradient(90% 35% at 0% 100%, rgba(250, 204, 21, 0.1), transparent 70%);
}

.sidebar::after {
  background-image:
    linear-gradient(rgba(234, 255, 246, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(234, 255, 246, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: linear-gradient(#000, transparent 55%);
  mask-image: linear-gradient(#000, transparent 55%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 22px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 72%, #fff), var(--accent));
  box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--accent) 90%, transparent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Logo rasmi oq plitka ustida turadi: yorug' va to'q fonda bir xil o'qiladi. */
img.brand-mark {
  padding: 4px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
  object-fit: contain;
}

.sidebar .brand {
  padding: 2px 6px 4px;
  color: #fff;
}

.sidebar .brand-mark {
  width: 40px;
  height: 40px;
  border-color: transparent;
  border-radius: 12px;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.6);
}

.brand-text {
  display: grid;
  line-height: 1.2;
}

.brand-sub {
  color: rgba(234, 255, 246, 0.55);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.nav {
  display: grid;
  align-content: start;
  gap: 18px;
  flex: 1;
  min-height: 0;
  margin: 0 -6px;
  padding: 0 6px;
  overflow-y: auto;
  scrollbar-width: none;
}

.nav-group {
  display: grid;
  gap: 2px;
}

.nav-title {
  padding: 0 12px 6px;
  color: rgba(234, 255, 246, 0.42);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  color: inherit;
  font-weight: 550;
  font-size: 14.5px;
  transition: background 0.15s, color 0.15s;
}

.nav a svg {
  color: rgba(234, 255, 246, 0.55);
  transition: color 0.15s;
}

.nav a:hover {
  background: rgba(234, 255, 246, 0.07);
  color: #fff;
}

.nav a.active {
  background: rgba(52, 211, 153, 0.16);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.22);
  color: #fff;
  font-weight: 620;
}

.nav a.active svg {
  color: #34d399;
}

/* Faol bo'lim yonidagi ingichka belgi. */
.nav a.active::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  width: 4px;
  height: 20px;
  border-radius: 0 4px 4px 0;
  background: #34d399;
  transform: translateY(-50%);
}

.nav a:focus-visible,
.me:focus-visible {
  outline-color: #34d399;
}

.nav-count {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #34d399;
  color: #05251a;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.sidebar-foot {
  position: relative;
}

/* Foydalanuvchi kartasi: bosilganda hisob menyusi ochiladi. */
.me {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(234, 255, 246, 0.1);
  border-radius: 14px;
  background: rgba(234, 255, 246, 0.06);
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.me:hover,
.me[aria-expanded='true'] {
  border-color: rgba(234, 255, 246, 0.2);
  background: rgba(234, 255, 246, 0.1);
}

.me .row-main {
  display: grid;
  line-height: 1.3;
}

.me .row-meta {
  color: rgba(234, 255, 246, 0.55);
}

.me > svg {
  color: rgba(234, 255, 246, 0.5);
}

.me-name {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hisob menyusi: kompyuterda karta ustida ochiladi, telefonda pastdan chiqadigan oynada. */
.account-menu {
  display: grid;
  gap: 2px;
}

.sidebar-foot .account-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 5;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  animation: menu-in 0.14s ease-out;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.account-menu button,
.account-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-weight: 550;
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
}

.account-menu button:hover,
.account-menu a:hover {
  background: var(--surface-2);
}

.account-menu svg {
  color: var(--muted);
}

.account-menu .nav-count {
  background: var(--accent);
  color: var(--on-accent);
}

.account-menu .is-danger,
.account-menu .is-danger svg {
  color: var(--red);
}

.topbar,
.tabbar {
  display: none;
}

@media (max-width: 860px) {
  .sidebar {
    display: none;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }

  .topbar .brand {
    padding: 0;
    font-size: 16px;
  }

  .topbar-me {
    display: grid;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
  }

  .tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 2px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }

  .tabbar a,
  .tabbar button {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 4px 2px 3px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 550;
    cursor: pointer;
  }

  .tabbar .tab-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 30px;
    border-radius: 999px;
    transition: background 0.15s, color 0.15s;
  }

  .tabbar .active {
    color: var(--accent);
    font-weight: 650;
  }

  .tabbar .active .tab-icon {
    background: var(--accent-soft);
  }

  .tabbar .tab-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tabbar .nav-count {
    position: absolute;
    top: 0;
    left: calc(50% + 8px);
    min-width: 18px;
    margin: 0;
    padding: 0 5px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 10.5px;
  }
}
