/* Isolated dashboard top bar — does not fight legacy .top-header a { width:46px } */
.dash-topbar,
.dash-topbar * {
  box-sizing: border-box;
}

.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
  margin: 0 auto;
  padding: .55rem .75rem;
  direction: rtl;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.dash-topbar#header-bg,
header.dash-topbar,
section.dash-topbar {
  height: auto !important;
  min-height: 64px;
}

.dash-topbar-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  direction: rtl;
  min-height: 48px;
}

.dash-brand {
  display: inline-flex !important;
  align-items: center;
  gap: .55rem;
  text-decoration: none !important;
  color: #0f172a !important;
  min-width: 0;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  flex-shrink: 0;
}

.dash-brand img {
  height: 36px !important;
  width: auto !important;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

.dash-brand-text {
  font-size: 1rem;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: -.01em;
}

.dash-brand-text .accent {
  color: #0d9488;
}

.dash-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: .45rem;
  min-width: 0;
}

.dash-topbar a,
.dash-topbar button,
.dash-topbar .dash-chip {
  width: auto !important;
  margin: 0 !important;
  max-width: none !important;
}

.dash-chip,
.dash-topbar .dash-chip {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  height: 36px;
  padding: 0 .85rem !important;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease, background .15s ease, box-shadow .15s ease;
}

.dash-chip:hover {
  transform: translateY(-1px);
  text-decoration: none !important;
}

.dash-chip img {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
}

.dash-chip-credit {
  background: #f0fdfa;
  border-color: rgba(13, 148, 136, .28) !important;
  color: #0f766e !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
}

.dash-chip-credit .amount {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.dash-chip-charge {
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 6px 14px rgba(13, 148, 136, .28);
}

.dash-chip-charge:hover {
  color: #fff !important;
  filter: brightness(1.05);
}

.dash-chip-home {
  background: #0f172a;
  color: #fff !important;
}

.dash-chip-home:hover {
  color: #fff !important;
}

.dash-chip-login {
  background: #0f172a;
  color: #fff !important;
}

.dash-chip-login:hover {
  color: #fff !important;
}

.dash-chip-logout {
  background: #fff;
  color: #dc2626 !important;
  border-color: rgba(220, 38, 38, .35) !important;
}

.dash-chip-logout:hover {
  background: #fef2f2;
  color: #b91c1c !important;
}

.dash-menu-btn {
  display: none;
  width: 38px !important;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, .08);
  cursor: pointer;
  padding: 0 !important;
  margin: 0 !important;
}

.dash-menu-btn img {
  width: 18px !important;
  height: 18px !important;
}

@media (max-width: 1024px) {
  .dash-menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 767.98px) {
  .dash-topbar {
    width: calc(100% - 1rem);
    margin: .35rem auto 0;
    padding: .45rem .6rem;
    border-radius: 12px;
  }

  .dash-brand-text {
    font-size: .9rem;
  }

  .dash-brand img {
    height: 30px !important;
  }

  .dash-chip {
    height: 32px;
    padding: 0 .65rem !important;
    font-size: .72rem;
  }

  .dash-chip-credit .label-desktop {
    display: none;
  }

  .dash-actions {
    gap: .3rem;
  }
}

/* Kill legacy top-header link sizing inside our bar */
.top-header.dash-topbar a,
.dash-topbar.top-header a,
.dash-topbar a:last-child {
  width: auto !important;
  font-size: inherit !important;
}
