/* Unified student portal topbar (My Wallet style) */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar--portal::before {
  display: none !important;
}

.topbar--portal {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.topbar--portal.topbar--with-search {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(200px, 1.4fr) auto;
  align-items: center;
}

.topbar--portal .page-subtitle {
  display: none;
}

.topbar--portal .page-title {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text);
}

.topbar--portal .topbar-center {
  display: flex;
  justify-content: center;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.topbar-search-ico {
  color: var(--muted);
  display: flex;
  flex-shrink: 0;
}

.topbar-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  background: transparent;
  color: var(--text);
  min-width: 0;
}

.topbar-search-input::placeholder {
  color: #94a3b8;
}

.topbar-right--portal {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar--portal .icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #fff;
  color: #111827;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  text-decoration: none;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.topbar--portal .icon-btn:hover {
  color: var(--primary-700);
  border-color: rgba(93, 95, 239, 0.28);
  box-shadow: 0 12px 26px rgba(93, 95, 239, 0.12);
  transform: translateY(-1px);
}

.topbar--portal .icon-btn svg {
  width: 21px;
  height: 21px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-user-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
}

.topbar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-700), #6366f1);
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(93, 95, 239, 0.16);
}

.topbar-avatar.has-image {
  background: #eef2ff;
  color: transparent;
}

.topbar-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.topbar-user-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.topbar-user-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.topbar-user-id {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar-logout-compact {
  padding: 8px 12px;
  font-size: 0.75rem;
}

@media (max-width: 900px) {
  .topbar--portal.topbar--with-search {
    display: flex;
    flex-wrap: wrap;
  }

  .topbar--portal .topbar-center {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin: 4px 0 0;
  }

  .topbar-user-name {
    max-width: 100px;
  }

  .topbar-user-block {
    display: none;
  }
}

@media (max-width: 560px) {
  .topbar-logout-compact {
    display: none;
  }
}
