/* ==========================================================================
   Roshdino header actions (v2.21.4)
   One size, one gap, one glass style for every header control:
   bell, theme toggle, settings, and the admin pill.
   Loaded after rd-liquid-glass so it wins the cascade.
   ========================================================================== */

:root {
  --rd-hdr-size: 44px;
  --rd-hdr-gap: 10px;
  --rd-hdr-radius: 22px;
}

/* ---- Row ----------------------------------------------------------------- */
html .topbar .topbar-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end;
  direction: rtl;
  gap: var(--rd-hdr-gap) !important;
  flex-wrap: nowrap !important;
  min-width: 0;
  flex-shrink: 0;
  margin-inline-start: auto;
}
html .topbar .topbar-actions > * {
  flex: 0 0 auto;
  margin: 0 !important;
}

/* ---- Round glass controls ------------------------------------------------ */
html .topbar .icon-btn,
html .topbar .top-avatar,
html .topbar .rd-header-settings {
  box-sizing: border-box !important;
  width: var(--rd-hdr-size) !important;
  height: var(--rd-hdr-size) !important;
  min-width: var(--rd-hdr-size) !important;
  min-height: var(--rd-hdr-size) !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative;
  line-height: 1;
  cursor: pointer;
  color: var(--rd-list-text, var(--foreground));
  background-color: color-mix(in srgb, var(--card, #1e2531) 72%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--border, #ffffff) 60%, transparent) !important;
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    inset 0 -1px 0 rgba(23, 36, 63, .08),
    0 8px 18px rgba(23, 36, 63, .14) !important;
  transition: transform .2s cubic-bezier(.22, 1, .36, 1), box-shadow .2s ease;
}
html.dark .topbar .icon-btn,
html.dark .topbar .top-avatar,
html.dark .topbar .rd-header-settings {
  background-color: color-mix(in srgb, #1e2531 70%, transparent) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 -1px 0 rgba(0, 0, 0, .3),
    0 8px 18px rgba(0, 0, 0, .35) !important;
}
html .topbar .icon-btn:active,
html .topbar .top-avatar:active,
html .topbar .rd-header-settings:active {
  transform: scale(.94);
}
html .topbar .icon-btn > svg,
html .topbar .icon-btn > i,
html .topbar .rd-header-settings > svg {
  width: 20px !important;
  height: 20px !important;
  flex: 0 0 20px;
  stroke-width: 1.7;
}
html .topbar .icon-btn:focus-visible,
html .topbar .rd-header-settings:focus-visible {
  outline: 2px solid var(--rd-blue, #326bd6);
  outline-offset: 2px;
}

/* ---- Admin / status pill, same height as the round controls -------------- */
html .topbar .rd-p2-api-badge {
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  height: var(--rd-hdr-size);
  min-height: var(--rd-hdr-size);
  padding: 0 16px;
  border-radius: var(--rd-hdr-radius);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  color: var(--rd-blue, #326bd6);
  background-color: color-mix(in srgb, var(--card, #1e2531) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--border, #ffffff) 60%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    0 8px 18px rgba(23, 36, 63, .14);
}
/* The plain "API + مدیریت واقعی" status label is developer text, not a control. */
html .topbar span.rd-p2-api-badge { display: none !important; }

/* ---- Small phones: keep the same rhythm, just tighter ------------------- */
@media (max-width: 380px) {
  :root { --rd-hdr-size: 40px; --rd-hdr-gap: 8px; --rd-hdr-radius: 20px; }
  html .topbar .rd-p2-api-badge { padding: 0 12px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html .topbar .icon-btn, html .topbar .top-avatar, html .topbar .rd-header-settings { transition: none; }
}
