.urdu-topbar {
  position: fixed;
  top: 10px;
  left: 86px;
  right: 1.5%;
  min-height: 50px;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 14px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur)) saturate(190%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(190%);
  border: 1px solid var(--glass-border-strong);
  border-radius: 20px;
  box-shadow: var(--glass-specular), var(--glass-shadow);
  transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

body.sidebar-expanded .urdu-topbar {
  left: 266px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  flex: 1 1 auto;
  max-width: none;
  opacity: 1;
  transform: translateX(0);
  transition: max-width 0.22s ease, opacity 0.18s ease, transform 0.22s ease;
}

body.sidebar-expanded .topbar-left {
  max-width: 0;
  opacity: 0;
  transform: translateX(-24px);
  pointer-events: none;
  margin-right: -8px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: clamp(11.5px, 0.95vw, 14px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-white {
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-cyan {
  color: var(--text-main);
}

.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 185px;
  max-width: 205px;
  min-width: 115px;
}

.topbar-search input {
  width: 100%;
  height: 36px;
  padding: 0 36px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--input-bg);
  color: var(--text-main);
  font-size: 13.5px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.topbar-search input:focus {
  border-color: var(--glass-border-strong);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.28);
}

.search-controls {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.search-count-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-accent);
  padding: 0 5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.search-nav-btn,
.search-lupa-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  opacity: 0.82;
  transition: all 0.14s ease;
}

.search-nav-btn:hover,
.search-lupa-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--glass-border);
}

.search-nav-btn svg,
.search-lupa-btn svg {
  width: 14px;
  height: 14px;
}

mark.urdu-find-mark {
  background: rgba(250, 204, 21, 0.42);
  color: inherit;
  padding: 1px 3px;
  border-radius: 4px;
  border-bottom: 2px solid #facc15;
}

mark.urdu-find-mark.current-match {
  background: #38bdf8;
  color: #090d16;
  font-weight: 700;
  border-bottom-color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.75);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.top-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  min-width: 38px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--input-bg);
  color: var(--text-main);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: var(--glass-specular);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.top-icon-btn:hover,
.hover-dropdown:hover > .top-icon-btn {
  border-color: #00e5ff !important;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.48), var(--glass-specular) !important;
  transform: scale(1.04);
}

html[data-theme="light"] .top-icon-btn:hover,
html[data-theme="light"] .hover-dropdown:hover > .top-icon-btn {
  border-color: #0284c7 !important;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.28) !important;
}


.top-icon-btn.active {
  background: rgba(0, 180, 216, 0.24) !important;
  border-color: #00e5ff !important;
  color: #00e5ff !important;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35), var(--glass-specular) !important;
}

html[data-theme="light"] .top-icon-btn.active {
  background: rgba(2, 132, 199, 0.16) !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

.kirish-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border-strong);
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--glass-specular);
  transition: transform 0.14s ease;
}

html[data-theme="light"] 
.top-icon-btn.active {
  background: rgba(0, 180, 216, 0.24) !important;
  border-color: #00e5ff !important;
  color: #00e5ff !important;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35), var(--glass-specular) !important;
}

html[data-theme="light"] .top-icon-btn.active {
  background: rgba(2, 132, 199, 0.16) !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

.kirish-pill-btn {
  background: #0f172a;
  color: #ffffff;
}

.kirish-pill-btn:hover {
  transform: scale(1.03);
}

.hover-dropdown {
  position: relative;
}

.hover-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 235px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid var(--glass-border-strong);
  border-radius: 18px;
  box-shadow: var(--glass-specular), var(--glass-shadow);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.15s ease;
  z-index: 1600;
}

.hover-dropdown:hover .hover-menu,
.hover-dropdown.open .hover-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.menu-opt {
  display: flex;
  align-items: center;
  justify-content: space-between !important;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 13px !important;
  border-radius: 12px !important;
  border: 1.5px solid transparent !important;
  background: transparent;
  color: var(--text-main);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.14s ease !important;
}

.menu-opt-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.menu-opt .opt-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.14s ease;
  color: #00e5ff;
}

.menu-opt:hover {
  background: rgba(255, 255, 255, 0.12);
}

.menu-opt.active {
  background: rgba(0, 180, 216, 0.24) !important;
  border-color: #00e5ff !important;
  color: #00e5ff !important;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.32), inset 0 0 8px rgba(0, 229, 255, 0.16) !important;
}

.menu-opt.active .opt-check {
  opacity: 1;
  transform: scale(1);
}

html[data-theme="light"] .menu-opt.active {
  background: rgba(2, 132, 199, 0.16) !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.2) !important;
}

html[data-theme="light"] .menu-opt.active .opt-check {
  color: #0284c7;
}

.urdu-sidebar {
  position: fixed;
  top: 10px;
  left: 10px;
  bottom: 10px;
  width: 64px;
  z-index: 1350;
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur)) saturate(190%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(190%);
  border: 1px solid var(--glass-border-strong);
  border-radius: 24px;
  box-shadow: var(--glass-specular), var(--glass-shadow);
  transition: width 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

body.sidebar-expanded .urdu-sidebar {
  width: 244px;
  padding: 14px 12px;
}

.sidebar-arrow-toggle {
  position: absolute;
  top: 20px;
  right: -13px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--glass-border-strong);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(16px);
  color: var(--text-main);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--glass-shadow);
  z-index: 1400;
}

.sidebar-arrow-toggle .chevron-svg {
  width: 14px;
  height: 14px;
  transition: transform 0.22s ease;
}

body.sidebar-expanded .sidebar-arrow-toggle .chevron-svg {
  transform: rotate(180deg);
}

.sidebar-brand-head {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 10px;
  text-decoration: none !important;
  color: var(--text-main);
}

body.sidebar-expanded .sidebar-brand-head {
  display: flex;
}

.sidebar-brand-emblem {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #059669 0%, #0284c7 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.sidebar-logo-title {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
}

.sidebar-logo-sub {
  font-size: 11.5px;
  color: var(--text-accent);
  margin-top: 2px;
  font-weight: 700;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 43px;
  padding: 8px;
  border-radius: 14px;
  color: var(--text-main);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none !important;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}

body.sidebar-expanded .sidebar-nav a {
  justify-content: flex-start;
  padding: 8px 12px;
}

.sidebar-nav a .nav-text {
  display: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.sidebar-nav a .nav-count-pill {
  display: none;
  font-size: 11.5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-main);
}

body.sidebar-expanded .sidebar-nav a .nav-text,
body.sidebar-expanded .sidebar-nav a .nav-count-pill {
  display: inline-block;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--glass-border);
}

.sidebar-nav a.active {
  background: rgba(255, 255, 255, 0.92);
  border-color: #ffffff;
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] .sidebar-nav a.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.sidebar-section-divider {
  display: none;
  margin: 10px 8px 3px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}

body.sidebar-expanded .sidebar-section-divider {
  display: block;
}

.sidebar-footer {
  margin-top: 8px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  text-align: center;
}

body.sidebar-expanded .sidebar-footer {
  text-align: left;
  padding: 10px;
}

.sidebar-footer .me-compact-icon {
  display: inline-flex;
  cursor: pointer;
}
body.sidebar-expanded .sidebar-footer .me-compact-icon { display: none; }
.sidebar-footer .me-details { display: none; }
body.sidebar-expanded .sidebar-footer .me-details { display: block; }

.profile-dropdown {
  position: relative;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 245px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid var(--glass-border-strong);
  border-radius: 18px;
  box-shadow: var(--glass-specular), var(--glass-shadow);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(0.97);
  transition: all 0.14s ease;
  z-index: 1650;
}

.profile-dropdown.open .profile-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.profile-menu-head {
  padding: 6px 10px 10px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 4px;
}

.profile-menu-head b {
  display: block;
  font-size: 14px;
  line-height: 1.3;
  color: var(--text-main);
}

.profile-menu-head span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-logout-opt {
  color: var(--bad) !important;
  border-top: 1px solid var(--line-soft) !important;
  margin-top: 4px !important;
  padding-top: 10px !important;
}

.profile-logout-opt:hover {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
}


.profile-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 3px 11px 3px 5px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--input-bg);
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--glass-specular);
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.profile-pill-btn:hover {
  border-color: #00e5ff;
}

.profile-pill-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--glass-border-strong);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.profile-pill-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  max-width: none;
}

.profile-pill-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.profile-pill-role {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 900px) {
  .urdu-topbar {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    top: 0 !important;
    min-height: 46px;
    padding: 6px 10px;
    border-radius: 0 0 14px 14px !important;
    border-top: none !important;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
  .topbar-actions {
    justify-content: center;
  }

  .topbar-left {
    max-width: 100% !important;
    width: 100%;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    margin-right: 0 !important;
  }

  .brand-title {
    font-size: 11.5px;
    line-height: 1.25;
    white-space: normal;
    display: block;
  }

  .topbar-search {
    flex: 1 1 130px;
    max-width: none;
    min-width: 100px;
  }

  .topbar-search input {
    height: 34px;
    padding: 0 34px 0 10px;
    font-size: 12px;
  }

  .search-nav-btn,
  .search-count-badge {
    display: none;
  }

  .top-icon-btn {
    height: 34px;
    min-width: 34px;
    padding: 0 7px;
    border-radius: 10px;
  }

  
.top-icon-btn.active {
  background: rgba(0, 180, 216, 0.24) !important;
  border-color: #00e5ff !important;
  color: #00e5ff !important;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35), var(--glass-specular) !important;
}

html[data-theme="light"] .top-icon-btn.active {
  background: rgba(2, 132, 199, 0.16) !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

.kirish-pill-btn {
    height: 34px;
    padding: 0 10px;
    font-size: 12.5px;
  }

  .urdu-sidebar {
    top: auto;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 64px;
    flex-direction: row;
    align-items: center;
    padding: 4px 6px !important;
    border-radius: 16px 16px 0 0 !important;
    border-bottom: none !important;
  }

  .sidebar-arrow-toggle,
  .sidebar-brand-head,
  .sidebar-section-divider,
  .sidebar-footer {
    display: none !important;
  }

  .sidebar-nav {
    flex-direction: row;
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 4px;
    scrollbar-width: none;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .sidebar-nav a {
    flex-direction: column;
    min-height: 50px;
    min-width: 48px;
    flex: 1 1 0;
    padding: 4px 3px !important;
    gap: 2px;
    justify-content: center !important;
  }

  .sidebar-nav a .u-svg {
    width: 17px;
    height: 17px;
  }

  .sidebar-nav a .nav-text {
    display: block !important;
    font-size: 8.5px;
    line-height: 1.1;
    text-align: center;
    max-width: 54px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .profile-pill-meta {
    display: none;
  }

  .profile-pill-btn {
    padding: 3px;
    min-height: 36px;
  }

  .sidebar-nav a .nav-count-pill {
    display: none !important;
  }
}

body.auth-locked .urdu-topbar {
  left: 1.5% !important;
  right: 1.5% !important;
}
body.auth-locked .topbar-left {
  max-width: none !important;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
  margin-right: 0 !important;
}
