/**
 * Global layout — NEZHNA .shadcn-container modeli
 *
 * Değişkenler (:root):
 *   --panel-content-max  Masaüstü içerik üst sınırı → 1280px
 *   --panel-gutter       Yan boşluk → masaüstü 0, mobil (≤767px) 1rem
 *
 * Nerede kullanılır:
 *   .panel-header__main  Üst menü
 *   .panel-content       base.html ana içerik (katalog, siparişler, API…)
 *   .panel-shell         Anasayfa bölümleri (landing-section ile aynı)
 *   .panel-page-head     Sayfa başlığı şeridi
 *
 * Mobil: içerik %100 genişlik + 1rem yan boşluk (NEZHNA ile aynı).
 * Katalog (≥1024px): sidebar + liste; liste alanı 1280px kalır.
 */

:root {
  --panel-content-max: 1280px;
  --panel-gutter: 0;
  --app-chrome-height: 4.8125rem;
}

@media (max-width: 767px) {
  :root {
    --panel-gutter: 1rem;
  }
}

/* Ortak içerik hizası — header / anasayfa / footer */
.panel-shell {
  width: 100%;
  max-width: var(--panel-content-max);
  margin-inline: auto;
  padding-inline: var(--panel-gutter);
  min-width: 0;
}

.app-chrome-header {
  height: var(--app-chrome-height);
  min-height: var(--app-chrome-height);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.app-chrome-header--sidebar {
  padding: 0 1.5rem;
}

.app-chrome-header__logo {
  height: 2.5rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.app-chrome-header__brand {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.25;
}

.dark .app-chrome-header__brand {
  color: #f4f4f5;
}

.topbar__page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.125rem;
  min-width: 0;
}

.topbar__page-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.25;
  color: #111827;
}

@media (min-width: 768px) {
  .topbar__page-title {
    font-size: 1.25rem;
  }
}

.dark .topbar__page-title {
  color: #f4f4f5;
}

.topbar__page-subtitle {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.25;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dark .topbar__page-subtitle {
  color: #a1a1aa;
}

.topbar__guest-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  white-space: nowrap;
}

.dark .topbar__guest-label {
  color: #a1a1aa;
}

.app-content {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  padding: 0.75rem 0;
}

@media (max-width: 767px) {
  .app-content {
    padding: 0.75rem var(--panel-gutter);
  }

  body.page-catalog .app-content {
    padding-top: 0 !important;
  }
}

.panel-content {
  width: 100%;
  max-width: var(--panel-content-max);
  margin-inline: auto;
  min-width: 0;
}

/* Katalog (≥1024px): sidebar yanında liste alanı 1280px */
.panel-content:has(.catalog-layout) {
  max-width: min(100%, calc(1280px + 17rem + 1.5rem));
}

@media (min-width: 1280px) {
  .panel-content:has(.catalog-layout) {
    max-width: min(100%, calc(1280px + 18.5rem + 1.75rem));
  }
}

/* Mobil / tablet: sidebar gizli → standart genişlik */
@media (max-width: 1023px) {
  .panel-content:has(.catalog-layout) {
    max-width: var(--panel-content-max);
  }
}

/* Bildirim tercihleri — sol: seçenekler, sağ: Telegram kartı */
.notify-prefs {
  width: 100%;
  min-width: 0;
}

.notify-prefs__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .notify-prefs__grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
    gap: 2rem;
  }

  .notify-prefs__telegram {
    position: sticky;
    top: 1.5rem;
  }
}

.notify-prefs__telegram-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.notify-prefs__telegram-icon {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: rgba(34, 158, 217, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.notify-prefs__telegram-icon i {
  font-size: 1.5rem;
  color: #229ED9;
}

.notify-prefs__telegram-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.notify-prefs__telegram-connect {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding: 1rem 1.5rem;
  border-radius: 0.875rem;
  background: linear-gradient(180deg, #2aabee 0%, #229ED9 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: none;
  box-shadow: 0 4px 14px rgba(34, 158, 217, 0.35);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.notify-prefs__telegram-connect:hover {
  background: linear-gradient(180deg, #229ED9 0%, #1d8bc4 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(34, 158, 217, 0.4);
}

.notify-prefs__telegram-connect.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.notify-prefs__telegram-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--notify-prefs-border, #f3f4f6);
}

.dark .notify-prefs__telegram-links {
  --notify-prefs-border: #27272a;
}

.notify-prefs__telegram-links a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #229ED9;
  text-decoration: none;
}

.notify-prefs__telegram-links a:hover {
  text-decoration: underline;
}

@media (min-width: 768px) {
  .app-content {
    padding: 1rem 1.25rem;
  }
}

@media (min-width: 1280px) {
  .app-content {
    padding: 1rem 1.5rem;
  }
}

/* Yönetim paneli — adm-page artık ortalanmaz, tam genişlik */
.adm-page {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.adm-page--narrow {
  max-width: 42rem;
}

/* Üst bar */
.topbar {
  flex-wrap: nowrap !important;
  overflow: hidden;
}

.topbar__left {
  min-width: 0;
  overflow: hidden;
}

.topbar__actions {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.topbar__logout-form {
  display: inline-flex;
  margin: 0;
  flex-shrink: 0;
}

.topbar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4375rem;
  height: 2.25rem;
  padding: 0 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  cursor: pointer;
}

.topbar__btn i {
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.topbar__btn--primary {
  background: var(--apple-blue, #0071e3);
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 0 1rem;
}

.topbar__btn--primary:hover {
  background: var(--apple-blue-hover, #0077ed);
}

.dark .topbar__btn--primary {
  background: var(--apple-blue, #0071e3);
  color: #fff;
}

.dark .topbar__btn--primary:hover {
  background: var(--apple-blue-hover, #0077ed);
}

.topbar__btn--accent {
  color: #6d28d9;
  border-color: #ddd6fe;
  background: #f5f3ff;
}

.topbar__btn--accent:hover {
  background: #ede9fe;
}

.dark .topbar__btn--accent {
  color: #c4b5fd;
  border-color: #4c1d95;
  background: #2e1065;
}

.header-balance-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
  flex-shrink: 1;
}

/* Bakiye yükle — hafif yeşil ton */
.deposit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border-radius: 0.5rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  border: 1px solid #86efac;
  color: #166534;
  background: #dcfce7;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.deposit-btn:hover {
  color: #14532d;
  background: #bbf7d0;
  border-color: #4ade80;
}

.deposit-btn i {
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.deposit-btn--topbar {
  height: 2.25rem;
  padding: 0 0.875rem;
  font-size: 0.875rem;
  border-radius: 999px;
  border: none;
  color: var(--apple-blue, #0071e3);
  background: rgba(0, 113, 227, 0.1);
  box-shadow: none;
}

.deposit-btn--topbar:hover {
  color: #fff;
  background: var(--apple-blue, #0071e3);
}

.dark .deposit-btn--topbar {
  color: #2997ff;
  background: rgba(41, 151, 255, 0.14);
}

.dark .deposit-btn--topbar:hover {
  color: #fff;
  background: var(--apple-blue, #0071e3);
}

.deposit-btn--sidebar {
  padding: 0.4rem 0.625rem;
  font-size: 0.6875rem;
}

.dark .deposit-btn {
  color: #bbf7d0;
  background: #14532d;
  border-color: #166534;
}

.dark .deposit-btn:hover {
  color: #dcfce7;
  background: #166534;
  border-color: #22c55e;
}

.sidebar-balance {
  margin: 0 0.5rem 0.5rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  background: #f0fdf4;
  border: 1px solid #dcfce7;
}

.dark .sidebar-balance {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.18);
}

.sidebar-balance__label {
  margin: 0 0 0.125rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #9ca3af;
}

.dark .sidebar-balance__label {
  color: #71717a;
}

.sidebar-balance__amount {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #15803d;
  line-height: 1.35;
}

.dark .sidebar-balance__amount {
  color: #86efac;
}

.sidebar-balance__extra {
  margin: 0.25rem 0 0;
  font-size: 0.6875rem;
  color: #9ca3af;
}

.dark .sidebar-balance__extra {
  color: #71717a;
}

.sidebar-balance__extra--unpaid {
  color: #b45309;
  font-weight: 600;
}

.dark .sidebar-balance__extra--unpaid {
  color: #fbbf24;
}

.header-user-chip__unpaid {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #b45309;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.dark .header-user-chip__unpaid {
  color: #fbbf24;
  background: #422006;
  border-color: #78350f;
}

.topbar__btn--ghost {
  color: var(--apple-header-muted, #6e6e73);
  font-weight: 500;
  border: none;
  border-radius: 999px;
  background: transparent;
}

.topbar__btn--ghost:hover {
  color: var(--apple-header-text, #1d1d1f);
  background: var(--apple-header-fill-hover, rgba(0, 0, 0, 0.07));
}

.dark .topbar__btn--ghost {
  color: var(--apple-header-muted, #a1a1a6);
  background: transparent;
}

.dark .topbar__btn--ghost:hover {
  color: var(--apple-header-text, #f5f5f7);
  background: var(--apple-header-fill-hover, rgba(255, 255, 255, 0.12));
}

.topbar__btn--lang {
  min-width: 2.125rem;
  padding: 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.topbar__btn--icon-only {
  width: 2.125rem;
  padding: 0;
}

.topbar__btn--logout {
  color: #4b5563;
  border-color: #e5e7eb;
  background: #f9fafb;
}

.topbar__btn--logout:hover {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fecaca;
}

.dark .topbar__btn--logout {
  color: #d4d4d8;
  border-color: #3f3f46;
  background: #27272a;
}

.dark .topbar__btn--logout:hover {
  color: #f87171;
  background: #450a0a;
  border-color: #7f1d1d;
}

/* xs: yalnızca ikon; sm+: kısa etiket */
.topbar__label {
  display: none;
}

@media (min-width: 640px) {
  .topbar__label {
    display: inline;
  }
}

.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;
}

/* Sol menü — vurgulu nav linkleri */
.sidebar-nav-link {
  display: flex;
  align-items: center;
  padding: 0.625rem 1rem 0.625rem calc(1rem - 3px);
  font-size: 0.875rem;
  color: #374151;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.dark .sidebar-nav-link {
  color: #d4d4d8;
}

.sidebar-nav-link__icon {
  width: 1.25rem;
  margin-right: 0.5rem;
  text-align: center;
  flex-shrink: 0;
  color: #6b7280;
  transition: color 0.15s ease;
}

.dark .sidebar-nav-link__icon {
  color: #a1a1aa;
}

.sidebar-nav-link.is-active {
  font-weight: 600;
  color: #111827;
}

.dark .sidebar-nav-link.is-active {
  color: #fafafa;
}

/* Mavi — katalog, siparişler */
.sidebar-nav-link--blue:hover {
  background: #f8fafc;
}

.sidebar-nav-link--blue.is-active {
  background: #eff6ff;
  border-left-color: #2563eb;
}

.sidebar-nav-link--blue.is-active .sidebar-nav-link__icon {
  color: #3b82f6;
}

.dark .sidebar-nav-link--blue:hover {
  background: rgba(59, 130, 246, 0.08);
}

.dark .sidebar-nav-link--blue.is-active {
  background: rgba(59, 130, 246, 0.14);
  border-left-color: #3b82f6;
}

.dark .sidebar-nav-link--blue.is-active .sidebar-nav-link__icon {
  color: #60a5fa;
}

/* Amber — hesap geçmişi */
.sidebar-nav-link--amber:hover {
  background: #fffbeb;
}

.sidebar-nav-link--amber.is-active {
  background: #fef3c7;
  border-left-color: #f59e0b;
}

.sidebar-nav-link--amber.is-active .sidebar-nav-link__icon {
  color: #d97706;
}

.dark .sidebar-nav-link--amber:hover {
  background: rgba(251, 191, 36, 0.08);
}

.dark .sidebar-nav-link--amber.is-active {
  background: rgba(251, 191, 36, 0.14);
  border-left-color: #f59e0b;
}

.dark .sidebar-nav-link--amber.is-active .sidebar-nav-link__icon {
  color: #fbbf24;
}

/* Amber — admin bölümü */
.sidebar-nav-link--admin:hover {
  background: #fffbeb;
}

.sidebar-nav-link--admin.is-active {
  background: #fef3c7;
  border-left-color: #f59e0b;
}

.sidebar-nav-link--admin.is-active .sidebar-nav-link__icon {
  color: #b45309;
}

.dark .sidebar-nav-link--admin:hover {
  background: rgba(251, 191, 36, 0.08);
}

.dark .sidebar-nav-link--admin.is-active {
  background: rgba(251, 191, 36, 0.14);
  border-left-color: #f59e0b;
}

.dark .sidebar-nav-link--admin.is-active .sidebar-nav-link__icon {
  color: #fbbf24;
}

/* Sol menü — Ayarlar alt menüsü */
.sidebar-settings__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.625rem 1rem 0.625rem calc(1rem - 3px);
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sidebar-settings__toggle:hover {
  background: #f8fafc;
}

.sidebar-settings__toggle.is-active {
  background: #f1f5f9;
  border-left-color: #64748b;
}

.dark .sidebar-settings__toggle {
  color: #d4d4d8;
}

.dark .sidebar-settings__toggle:hover {
  background: rgba(100, 116, 139, 0.1);
}

.dark .sidebar-settings__toggle.is-active {
  background: rgba(100, 116, 139, 0.16);
  border-left-color: #94a3b8;
}

.sidebar-settings__chevron {
  transition: transform 0.2s ease;
}

.sidebar-settings__chevron.is-open {
  transform: rotate(180deg);
}

.sidebar-settings__sub {
  list-style: none;
  margin: 0;
  padding: 0.125rem 0 0.375rem;
}

.sidebar-settings__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem 0.5rem calc(2.75rem - 3px);
  font-size: 0.8125rem;
  color: #6b7280;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sidebar-settings__link i {
  width: 1rem;
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.85;
}

.sidebar-settings__link:hover {
  background: #f8fafc;
  color: #111827;
}

.sidebar-settings__link.is-active {
  background: #f1f5f9;
  border-left-color: #64748b;
  color: #111827;
  font-weight: 600;
}

.dark .sidebar-settings__link {
  color: #a1a1aa;
}

.dark .sidebar-settings__link:hover {
  background: rgba(100, 116, 139, 0.1);
  color: #f4f4f5;
}

.dark .sidebar-settings__link.is-active {
  background: rgba(100, 116, 139, 0.16);
  border-left-color: #94a3b8;
  color: #fff;
}

/* Panel içi sekmeler */
.panel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .panel-tabs {
  border-bottom-color: #3f3f46;
}

.panel-tabs__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: -1px;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.panel-tabs__btn:hover {
  color: #111827;
}

.panel-tabs__btn.is-active {
  color: #6d28d9;
  font-weight: 700;
  border-bottom: 3px solid #2563eb;
}

.dark .panel-tabs__btn {
  color: #a1a1aa;
}

.dark .panel-tabs__btn:hover {
  color: #f4f4f5;
}

.dark .panel-tabs__btn.is-active {
  color: #c4b5fd;
  border-bottom-color: #a78bfa;
}

[x-cloak] {
  display: none !important;
}

/* —— Mobil: üst bar & sidebar —— */
@media (max-width: 639px) {
  :root {
    --app-chrome-height: 3.5rem;
  }

  .app-chrome-header--sidebar {
    padding: 0 1rem;
  }

  .app-chrome-header__logo {
    height: 2rem;
  }

  .app-chrome-header__brand {
    font-size: 1.125rem;
  }

  .topbar {
    gap: 0.25rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .topbar__page-title {
    font-size: 1rem;
  }

  .topbar__page-subtitle {
    display: none;
  }

  .topbar__left {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  .topbar__actions {
    gap: 0.125rem;
    flex-shrink: 0;
  }

  .topbar__btn {
    height: 2rem;
    padding: 0 0.4375rem;
    font-size: 0.75rem;
  }

  .topbar__btn i {
    font-size: 0.75rem;
  }

  .topbar__btn--icon-only,
  .topbar__btn--lang {
    width: 2rem;
    min-width: 2rem;
    padding: 0;
  }

  .header-balance-group {
    gap: 0.25rem;
    min-width: 0;
  }

  .header-user-chip {
    min-width: 0;
    overflow: hidden;
  }

  .header-user-chip__balance {
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .deposit-btn--topbar {
    width: 2rem;
    height: 2rem;
    padding: 0;
  }

  .deposit-btn--topbar .deposit-btn__label {
    display: none;
  }

  #mainSidebar {
    width: min(16rem, 88vw);
    padding-bottom: env(safe-area-inset-bottom);
  }

  #mainSidebar nav {
    -webkit-overflow-scrolling: touch;
  }

  #sidebarOverlay:not(.hidden) {
    display: block !important;
  }
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
}

.sidebar-footer__lang {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.sidebar-footer__lang-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9ca3af;
}

.dark .sidebar-footer__lang-label {
  color: #71717a;
}

.sidebar-footer__lang .lang-switcher {
  width: 100%;
  max-width: none;
}
.sidebar-footer__lang .lang-switcher .lang-switcher__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 50%;
  width: auto;
  min-height: 2.25rem;
  padding: 0 0.5rem;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 380px) {
  .topbar__btn--lang {
    display: none;
  }
}

/* —— Üst header — Apple tarzı cam şerit —— */
.panel-app {
  --panel-header-height: 4.125rem;
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-header-text: #1d1d1f;
  --apple-header-muted: #48484a;
  --apple-header-fill: rgba(0, 0, 0, 0.05);
  --apple-header-fill-hover: rgba(0, 0, 0, 0.08);
  --apple-header-active: rgba(0, 0, 0, 0.07);
}

.dark .panel-app {
  --apple-header-text: #f5f5f7;
  --apple-header-muted: #d1d1d6;
  --apple-header-fill: rgba(255, 255, 255, 0.1);
  --apple-header-fill-hover: rgba(255, 255, 255, 0.14);
  --apple-header-active: rgba(255, 255, 255, 0.12);
}

.panel-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.dark .panel-header {
  background: rgba(22, 22, 23, 0.78);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.panel-header__main {
  max-width: var(--panel-content-max);
  margin: 0 auto;
  padding: 0.5rem var(--panel-gutter);
  min-height: var(--panel-header-height);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 1.5rem;
}

@media (min-width: 768px) {
  .panel-header__main {
    padding-inline: 1.25rem;
  }
}

.panel-header__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex-shrink: 0;
  grid-column: 1;
  justify-self: start;
}

.panel-header__menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--apple-header-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

@media (min-width: 768px) {
  .panel-header__menu-btn {
    display: none;
  }
}

.panel-header__menu-btn:hover {
  background: var(--apple-header-fill-hover);
  color: var(--apple-header-text);
}

.panel-header__logo-link {
  display: flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.panel-header__logo {
  height: 2.125rem;
  width: auto;
  max-width: 11rem;
  object-fit: contain;
}

.panel-header__brand-text {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--apple-header-text);
}

.panel-header__nav-shell {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 0;
  grid-column: 2;
}

@media (min-width: 768px) {
  .panel-header__nav-shell {
    display: flex;
  }
}

.panel-header__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  min-width: 0;
  flex-wrap: nowrap;
  padding: 0;
  background: transparent;
  border: none;
}

@media (min-width: 768px) {
  .panel-header__nav {
    display: inline-flex;
    gap: 0.375rem;
  }
}

.panel-header__nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--apple-header-muted);
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease, transform 0.12s ease;
}

@media (min-width: 768px) {
  .panel-header__nav-link {
    padding: 0.5rem 0.8125rem;
    font-size: 0.875rem;
  }
}

@media (min-width: 1024px) {
  .panel-header__nav-link {
    padding: 0.5rem 0.875rem;
    font-size: 0.9375rem;
    gap: 0.5rem;
  }

  .panel-header__nav-link .panel-header__nav-icon {
    display: inline-flex;
    opacity: 0.88;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .panel-header__nav-link .panel-header__nav-icon {
    display: none;
  }
}

.panel-header__nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  line-height: 1;
  color: inherit;
  opacity: 0.78;
  transition: opacity 0.18s ease;
}

.panel-header__nav-icon i {
  display: block;
  font-size: 0.875rem;
  line-height: 1;
  width: 1rem;
  text-align: center;
}

.panel-header__nav-label {
  line-height: 1.15;
}

.panel-header__nav-link:hover {
  color: var(--apple-header-text);
  background: var(--apple-header-fill-hover);
  transform: translateY(-0.5px);
}

.panel-header__nav-link:hover .panel-header__nav-icon,
.panel-header__nav-link.is-active .panel-header__nav-icon {
  opacity: 1;
}

.panel-header__nav-link--admin.is-active {
  color: #b45309;
  background: rgba(255, 251, 235, 0.9);
}

.dark .panel-header__nav-link--admin.is-active {
  color: #fbbf24;
  background: rgba(66, 32, 6, 0.45);
}

.panel-header__dropdown {
  position: relative;
}

.panel-header__dropdown-menu--end {
  left: auto;
  right: 0;
}

.panel-header__dropdown-menu--teleport {
  position: fixed;
  z-index: 200;
  margin: 0;
  box-sizing: border-box;
}

@media (max-width: 767px) {
  .panel-header__dropdown-menu--teleport.panel-header__account-menu {
    left: max(1rem, env(safe-area-inset-left));
    right: max(1rem, env(safe-area-inset-right));
    width: auto;
    min-width: 0;
    max-width: none;
  }
}

@media (min-width: 768px) {
  .panel-header__dropdown-menu--teleport.panel-header__account-menu {
    min-width: 13.5rem;
    max-width: min(18rem, calc(100vw - 1rem));
  }
}

.panel-header__dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
}

.panel-header__dropdown-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.panel-header__account-menu {
  min-width: 13.5rem;
}

.panel-header__account-head {
  padding: 0.625rem 0.75rem 0.5rem;
}

.panel-header__account-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.panel-header__account-balance {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.panel-header__dropdown-label {
  margin: 0;
  padding: 0.25rem 0.75rem 0.125rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.panel-header__dropdown-divider {
  height: 1px;
  margin: 0.25rem 0.35rem;
  background: var(--color-border-light);
}

.panel-header__dropdown-item--danger {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--color-danger);
}

.panel-header__dropdown-item--danger:hover {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.panel-header__logout-form {
  margin: 0;
}

.panel-header__mobile-label {
  margin: 0.75rem 0 0.25rem;
  padding: 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.panel-header__mobile-sublabel {
  margin: 0.5rem 0 0.125rem;
  padding: 0 0.25rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  opacity: 0.85;
}

.panel-header__nav-link.is-active {
  color: var(--apple-header-text);
  font-weight: 600;
  background: var(--apple-header-active);
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}

.dark .panel-header__nav-link.is-active {
  background: var(--apple-header-active);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
}

.panel-header__actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
  grid-column: 3;
  justify-self: end;
  margin-left: 0;
}

.topbar-lang .lang-switcher {
  padding: 0;
  border-radius: 0.5rem;
  background: transparent;
  border: none;
  overflow: visible;
}

.topbar-lang .lang-switcher__btn {
  border-radius: 999px;
  min-height: 2.125rem;
  padding: 0 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--apple-header-muted);
  background: transparent;
}

.topbar-lang .lang-switcher__btn:hover {
  color: var(--apple-header-text);
  background: var(--apple-header-fill-hover);
}

.topbar-lang .lang-switcher__btn.is-active {
  color: var(--apple-header-text);
  background: var(--apple-header-fill);
}

.panel-header__actions .theme-toggle {
  border-radius: 999px;
  border: none !important;
  background: transparent;
}

.panel-header__actions .theme-toggle:hover {
  background: var(--apple-header-fill-hover);
}

.panel-header__account-zone {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0;
  padding-left: 0;
  border-left: none;
}

.panel-header__balance-pill {
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.panel-header__balance-pill--positive,
.panel-header__account-balance--positive {
  color: var(--color-success, #16a34a);
}

.panel-header__balance-pill--nonpositive,
.panel-header__account-balance--nonpositive {
  color: var(--color-danger, #dc2626);
}

.dark .panel-header__balance-pill--positive,
.dark .panel-header__account-balance--positive {
  color: #4ade80;
}

.dark .panel-header__balance-pill--nonpositive,
.dark .panel-header__account-balance--nonpositive {
  color: #f87171;
}

.panel-header__account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  height: 2.25rem;
  padding: 0 0.875rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--apple-header-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.dark .panel-header__account-trigger {
  background: transparent;
}

.panel-header__account-trigger:hover,
.panel-header__account-trigger.is-active {
  color: var(--apple-header-text);
  background: var(--apple-header-fill-hover);
}

.panel-header__dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 11rem;
  padding: 0.35rem;
  border-radius: 0.875rem;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.dark .panel-header__dropdown-menu {
  background: rgba(36, 36, 38, 0.92);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.panel-header__account-trigger-icon {
  font-size: 1rem;
  opacity: 0.85;
}

.panel-header__account-trigger-caret {
  font-size: 0.5625rem;
  opacity: 0.65;
}

@media (max-width: 767px) {
  .panel-header__actions {
    gap: 0.375rem;
  }

  .panel-header__balance-pill {
    font-size: 0.8125rem;
    max-width: 6.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .deposit-btn--topbar {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    padding: 0;
    justify-content: center;
    border-radius: 999px;
  }

  .deposit-btn--topbar .deposit-btn__label {
    display: none;
  }
}

@media (max-width: 1023px) {
  .panel-header__account-trigger-label {
    display: none;
  }

  .panel-header__account-trigger {
    padding: 0 0.625rem;
  }
}

.panel-header__mobile {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  border-top: 0.5px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  width: 100%;
  padding: 0.875rem var(--panel-gutter);
}

.dark .panel-header__mobile {
  background: rgba(22, 22, 23, 0.94);
  border-top-color: rgba(255, 255, 255, 0.08);
}

.panel-header__mobile.is-open {
  display: flex;
}

.panel-header__mobile .panel-header__nav-link {
  display: flex;
  width: 100%;
  padding: 0.6875rem 0.625rem;
  font-size: 1rem;
  border-radius: 0.625rem;
}

.panel-header__mobile a:not(.panel-header__nav-link),
.panel-header__mobile button {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 0.5625rem 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--apple-header-muted);
  text-decoration: none;
  background: none;
  border: none;
  border-radius: 0.625rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.panel-header__mobile a:not(.panel-header__nav-link):hover,
.panel-header__mobile button:hover {
  background: var(--apple-header-fill-hover);
  color: var(--apple-header-text);
}

.panel-header__mobile-lang {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border-light);
}

.panel-cat-nav {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
}

.panel-cat-nav__scroll {
  max-width: var(--panel-content-max);
  margin: 0 auto;
  padding: 0.5rem var(--panel-gutter);
  display: flex;
  gap: 0.375rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

@media (min-width: 768px) {
  .panel-cat-nav__scroll {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

.panel-cat-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.panel-cat-nav__link:hover {
  color: var(--color-text);
  background: var(--color-bg-hover);
}

.panel-cat-nav__link.is-active {
  color: #fff;
  background: var(--cat-color, var(--brand-color, #2563eb));
  border-color: transparent;
  font-weight: 600;
}

.panel-cat-nav__count {
  font-size: 0.6875rem;
  font-weight: 600;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

.panel-main {
  width: 100%;
  min-width: 0;
}

.panel-page-head {
  max-width: var(--panel-content-max);
  margin: 0 auto;
  width: 100%;
  padding: 0.75rem var(--panel-gutter) 0;
}

.panel-page-head:empty {
  display: none;
}
