/**
 * Trendmetrik UI v2 — üst şerit (kalıcı)
 * header.html içindeki inline <style> buraya taşındı; v2 chrome tm-v2-reference-chrome ile birleştirildi.
 */

#tmv2App {
  /* Header height variable — used for consistent spacing. Header is now sticky (not fixed). */
  --tmv2-header-offset: 60px;
}

/* Dil menüsü — SVG bayrak img */
.tm-lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  flex-shrink: 0;
}

.tm-lang-flag-img {
  display: block;
  width: 22px;
  max-width: 22px;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  vertical-align: middle;
}

html.dark-mode .tm-lang-flag-img {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Eski layout: sol tmv2 sidebar yoksa */
@media (min-width: 992px) {
  html:not(:has(#tmv2SidebarRoot)) .sidebar {
    top: 76px;
    height: calc(100vh - 76px);
  }
}

/* #mainContent üst boşluk: tm-v2-overrides.css (base head sonunda !important; hesap sayfaları hariç) */

/* === Legacy header shell (overridden by #tmv2App rules below) === */
    body.bg-secondary-100 {
      background: var(--tmv2-surface-3) !important;
    }

    /* Legacy: only applies when NOT inside #tmv2App */
    body:not(:has(#tmv2App)) .header-wrapper {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 1030;
      padding: 20px;
      background: transparent;
    }

    body:not(:has(#tmv2App)) .header-bar {
      background: var(--tmv2-surface);
      border-radius: var(--tmv2-r-xl);
      box-shadow: var(--tmv2-sh-2);
      padding: var(--tmv2-sp-3) var(--tmv2-sp-6);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: var(--tmv2-sp-4);
      max-width: none;
      width: 100%;
      margin: 0;
      flex-wrap: wrap;
      border: 1px solid var(--tmv2-line-2);
      box-sizing: border-box;
    }
    
    .header-logo-section {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    
    .header-logo-icon {
      width: 40px;
      height: 40px;
      background: transparent;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--tm-fg-on-brand);
      font-weight: bold;
      font-size: 18px;
      overflow: hidden;
    }
    
    /* Sayfa adı — header ile uyumlu, okunaklı tipografi */
    .header-logo-link {
      text-decoration: none !important;
      color: var(--tmv2-ink) !important;
      gap: 0.625rem;
      border-radius: 10px;
      transition: background-color 0.18s ease;
    }
    .header-logo-link:hover {
      background: rgba(15, 23, 42, 0.04);
    }
    .header-logo-link:focus-visible {
      outline: 2px solid rgba(var(--color-primary-rgb), 0.45);
      outline-offset: 2px;
    }
    .header-logo-text {
      font-size: 1.0625rem !important;
      font-weight: 600 !important;
      color: var(--tmv2-ink) !important;
      letter-spacing: -0.03em !important;
      line-height: 1.2 !important;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      transition: color 0.18s ease;
    }
    .header-logo-link:hover .header-logo-text {
      color: var(--color-primary) !important;
    }
    
    .header-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    /* Narrow desktop / tablet (≥md, <xl): the header packs 5+ actions and gets
       crowded between ~960–1199px. The text labels on `Sync aktif` and
       `Nasıl Yapılır?` are hidden via Bootstrap responsive classes (d-xl-inline)
       at this range, so the corresponding pill/button collapses to a compact
       icon-only form. Tighten the inter-action gap and `Nasıl Yapılır?` padding
       so the row breathes without changing the desktop ≥xl layout. */
    @media (min-width: 768px) and (max-width: 1199.98px) {
      .header-actions { gap: 6px; }
      .btn-nasil-yapilir { padding: 8px 12px; gap: 0; }
      .tmv2-header-status { padding-left: 8px; padding-right: 8px; }
    }

    .btn-nasil-yapilir {
      background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%); /* Baklava Primary */
      color: var(--tm-fg-on-brand);
      border: none;
      border-radius: 8px; /* Baklava border-radius-sm */
      padding: 8px 16px;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
      transition: all 0.3s ease;
      text-decoration: none;
      box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.2); /* Baklava shadow */
    }
    
    .btn-nasil-yapilir:hover {
      background: linear-gradient(135deg, var(--color-primary-hover) 0%, var(--color-primary) 100%);
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.3); /* Baklava Primary Shadow */
      color: var(--tm-fg-on-brand);
    }
    
    .btn-nasil-yapilir-icon {
      width: 20px;
      height: 20px;
      background: var(--tm-warning-light);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
    }
    
    
    @media (max-width: 768px) {
      .header-bar {
        padding: 8px 10px;
        gap: 6px;
        justify-content: flex-start;
        min-height: 56px;
      }
      
      .header-logo-section {
        display: none !important;
      }
      
      .header-logo-text {
        display: none;
      }
      
      .header-logo-icon {
        display: none !important;
      }
      
      .btn-nasil-yapilir {
        display: none !important;
      }
      
      #mobileMenuToggle {
        margin-right: 8px !important;
        padding: 8px !important;
        min-width: 40px;
        min-height: 40px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
      }
      
      /* Masaüstünde mobile menu butonunu gizle */
      @media (min-width: 1025px) {
        #mobileMenuToggle {
          display: none !important;
        }
      }
      
      #mobileMenuToggle i {
        width: 20px !important;
        height: 20px !important;
      }
      
      .header-actions {
        gap: 6px;
        flex-wrap: nowrap;
        margin-left: auto;
        display: flex;
        align-items: center;
      }
      
      .header-dropdown-btn {
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        min-width: 40px !important;
        min-height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0;
      }
      
      .header-dropdown-btn i {
        width: 18px !important;
        height: 18px !important;
      }
      
      #accountMenuToggle {
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        min-width: 40px !important;
        min-height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0;
      }
      
      #accountMenuToggle > div {
        width: 32px !important;
        height: 32px !important;
        border-width: 2px !important;
      }
      
      #accountMenuToggle i {
        width: 16px !important;
        height: 16px !important;
      }
      
      #notificationsToggle {
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        min-width: 40px !important;
        min-height: 40px !important;
      }
      
      .header-wrapper {
        padding: 1vw;
      }
      
      .api-warning-banner {
        order: 3 !important;
        width: 100% !important;
        margin: 8px 0 0 0 !important;
      }
      
      .api-warning-banner > div {
        font-size: 12px !important;
        padding: 6px 12px !important;
      }
      
      .api-warning-banner span {
        font-size: 12px !important;
      }
    }
    
    @keyframes pulse {
      0%, 100% {
        opacity: 1;
        transform: scale(1);
      }
      50% {
        opacity: 0.9;
        transform: scale(1.02);
      }
    }
    
    /* Subscription Expiry Banner Styles */
    .subscription-expiry-banner {
      display: none;
    }
    
    .subscription-expiry-banner.visible {
      display: flex;
      align-items: center;
    }
    
    .subscription-banner-inner {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 14px;
      border-radius: 10px;
      font-size: 13px;
      font-weight: 600;
      text-decoration: none;
      transition: all 0.3s ease;
      white-space: nowrap;
    }
    
    .subscription-banner-inner:hover {
      transform: translateY(-1px);
      text-decoration: none;
    }
    
    .subscription-banner-inner .banner-icon {
      font-size: 14px;
      flex-shrink: 0;
    }
    
    .subscription-banner-inner .banner-text {
      line-height: 1.2;
    }
    
    .subscription-banner-inner .banner-link {
      font-weight: 700;
      text-decoration: none;
      margin-left: 4px;
      transition: opacity 0.2s;
    }
    
    .subscription-banner-inner .banner-link:hover {
      opacity: 0.8;
    }
    
    /* Banner renk varyasyonları */
    .subscription-banner-critical {
      background: linear-gradient(135deg, var(--tm-error-bg) 0%, var(--tm-error-border) 100%);
      border: 1.5px solid var(--color-danger);
      color: var(--color-danger);
      box-shadow: var(--tmv2-sh-1);
      animation: pulse 2s infinite;
    }
    
    .subscription-banner-critical .banner-icon {
      color: var(--color-danger);
    }
    
    .subscription-banner-critical .banner-link {
      color: var(--color-danger);
    }
    
    .subscription-banner-warning {
      background: linear-gradient(135deg, var(--tm-warning-bg) 0%, var(--tm-warning-light) 100%);
      border: 1.5px solid var(--tmv2-warning);
      color: var(--color-text);
      box-shadow: var(--tmv2-sh-1);
    }
    
    .subscription-banner-warning .banner-icon {
      color: var(--tmv2-warning-border);
    }
    
    .subscription-banner-warning .banner-link {
      color: var(--tmv2-warning-border);
    }
    
    .subscription-banner-info {
      background: linear-gradient(135deg, var(--color-secondary-soft) 0%, var(--tm-info-border) 100%);
      border: 1.5px solid var(--color-primary);
      color: var(--color-primary-hover);
      box-shadow: var(--tmv2-sh-1);
    }
    
    .subscription-banner-info .banner-icon {
      color: var(--color-primary);
    }
    
    .subscription-banner-info .banner-link {
      color: var(--color-primary);
    }
    
    @media (max-width: 768px) {
      .subscription-expiry-banner.visible {
        display: flex !important;
        align-items: center;
        max-width: min(100vw - 100px, 220px);
        overflow: hidden;
      }
      .subscription-expiry-banner.visible .subscription-banner-inner {
        font-size: 11px;
        padding: 6px 8px;
        white-space: normal;
        line-height: 1.25;
      }
    }
    
    @media (max-width: 1100px) and (min-width: 769px) {
      .subscription-banner-inner {
        padding: 6px 10px;
        font-size: 11px;
      }
      
      .subscription-banner-inner .banner-icon {
        font-size: 12px;
      }
    }
/* === Dropdown, bildirim, tutorial === */
/* Tutorial step button styles */
    .tutorial-step-btn {
      cursor: pointer;
    }
    
    .tutorial-step-btn:hover {
      box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
    }
    
    /* Header Dropdown Styles */
    .header-dropdown-btn {
      position: relative;
      z-index: 1001;
    }
    
    .header-dropdown-btn:hover {
      transform: translateY(-2px);
      background: rgba(59, 130, 246, 0.08) !important;
    }
    
    .header-dropdown-btn:active {
      transform: translateY(0);
    }
    
    .header-dropdown {
      position: absolute;
      top: 100%;
      right: 0;
      z-index: var(--tmv2-z-dropdown);
      background: var(--tmv2-surface);
      overflow: hidden;
    }
    
    .header-dropdown.show {
      display: block !important;
      opacity: 1 !important;
      transform: translateY(0) !important;
    }
    
    .header-dropdown.closing {
      opacity: 0 !important;
      transform: translateY(-10px) !important;
    }
    
    .header-dropdown-item {
      padding: var(--tmv2-sp-3) var(--tmv2-sp-5);
      color: var(--tmv2-ink-2);
      text-decoration: none;
      display: flex;
      align-items: center;
      transition: all 0.2s ease;
      border: none;
      background: transparent;
    }
    
    .header-dropdown-item:hover {
      background: linear-gradient(90deg, var(--tmv2-surface-3) 0%, var(--tmv2-surface-2) 100%);
      color: var(--color-text);
      padding-left: var(--tmv2-sp-6);
    }
    
    .header-dropdown-item i {
      color: var(--color-text-muted);
      transition: color 0.2s ease;
    }
    
    .header-dropdown-item:hover i {
      color: var(--color-primary);
    }

    /* =============================================================
       ACCOUNT DROPDOWN (#accountDropdown / .header-dropdown--account)
       Polished design — token-driven, theme-aware, sectioned.
       ============================================================= */
    .header-dropdown.header-dropdown--account {
      min-width: 260px;
      max-width: calc(100vw - 20px);
      border: none;
      border-radius: 14px;
      margin-top: 8px;
      padding: 0 0 var(--tmv2-sp-2);
      background: var(--tm-bg-card, #ffffff);
      box-shadow:
        0 6px 24px rgba(15, 23, 42, 0.10),
        0 1px 4px rgba(15, 23, 42, 0.06);
      opacity: 0;
      transform: translateY(-10px);
      transition: opacity 0.2s ease, transform 0.2s ease;
      overflow: hidden;
    }
    .header-dropdown.header-dropdown--account.show {
      opacity: 1;
      transform: translateY(0);
    }

    /* Profile section: avatar + name + email */
    .header-dropdown__profile {
      padding: 14px var(--tmv2-sp-5);
      background: linear-gradient(
        135deg,
        var(--tm-primary-soft, #e8f3ff) 0%,
        var(--tm-bg-secondary, #f3f7fb) 100%
      );
      border-bottom: 1px solid var(--tm-border-color, #dbe5ef);
    }
    .header-dropdown__profile-row {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
    }
    .header-dropdown__avatar {
      flex: none;
      width: 42px;
      height: 42px;
      border-radius: 50%;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--tm-account-cta-gradient,
        linear-gradient(135deg, var(--color-primary, #0175e4) 0%, var(--color-primary-hover, #0163c2) 100%));
      box-shadow: 0 2px 8px rgba(var(--color-primary-rgb, 1, 117, 228), 0.25);
      color: #ffffff;
    }
    .header-dropdown__avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .header-dropdown__avatar i,
    .header-dropdown__avatar svg {
      width: 20px;
      height: 20px;
    }
    .header-dropdown__profile-info {
      flex: 1 1 auto;
      min-width: 0;
    }
    .header-dropdown__name {
      font-size: 0.9rem;
      font-weight: 600;
      color: var(--tm-text-primary, #1e293b);
      line-height: 1.25;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .header-dropdown__email {
      font-size: 0.75rem;
      color: var(--tm-text-secondary, #64748b);
      line-height: 1.3;
      margin-top: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* Section label: tiny uppercase muted text grouping items */
    .header-dropdown__section-label {
      list-style: none;
      padding: 10px var(--tmv2-sp-5) 4px;
      font-size: 0.65rem;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--tm-text-muted, #94a3b8);
    }

    /* Divider — minimal margin, theme-aware color */
    .header-dropdown__divider {
      margin: var(--tmv2-sp-2) var(--tmv2-sp-3);
      border: 0;
      border-top: 1px solid var(--tm-border-color, #dbe5ef);
      opacity: 1;
    }

    /* Item layout: icon-chip + text (replaces inline icon) */
    .header-dropdown.header-dropdown--account .header-dropdown-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 8px var(--tmv2-sp-5);
      color: var(--tm-text-primary, #1e293b);
      font-size: 0.875rem;
      font-weight: 500;
      border-radius: 0;
      transition: background-color 0.15s ease, color 0.15s ease, padding-left 0.18s ease;
    }
    .header-dropdown.header-dropdown--account .header-dropdown-item:hover {
      background: var(--tm-bg-hover, var(--tm-primary-soft, #e8f3ff));
      color: var(--tm-text-primary, #1e293b);
      padding-left: calc(var(--tmv2-sp-5) + 4px);
    }
    /* Override the older "all: linear-gradient" hover from the global rule */
    .header-dropdown.header-dropdown--account .header-dropdown-item {
      background: transparent;
    }

    /* Icon chip: small tinted square holding the lucide icon */
    .header-dropdown-item__icon {
      flex: none;
      width: 28px;
      height: 28px;
      border-radius: 8px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: var(--tm-bg-tertiary, #f1f5f9);
      color: var(--tm-text-secondary, #64748b);
      transition: background-color 0.15s ease, color 0.15s ease;
    }
    .header-dropdown-item__icon i,
    .header-dropdown-item__icon svg {
      width: 15px !important;
      height: 15px !important;
      flex: none;
    }
    .header-dropdown.header-dropdown--account .header-dropdown-item:hover .header-dropdown-item__icon {
      background: var(--tm-primary-soft, #e8f3ff);
      color: var(--tm-primary, #0175e4);
    }

    /* Accent variant — used for "Mağaza Yönetimi" (admin link).
       Was incorrectly red; now neutral with brand accent on hover. */
    .header-dropdown-item__icon--accent {
      background: var(--tm-accent-soft, #fff1e8);
      color: var(--tm-accent, #fd751f);
    }
    .header-dropdown.header-dropdown--account .header-dropdown-item:hover .header-dropdown-item__icon--accent {
      background: var(--tm-accent, #fd751f);
      color: #ffffff;
    }

    .header-dropdown-item__text {
      flex: 1 1 auto;
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* Danger variant: only logout. Red-tinted on hover. */
    .header-dropdown.header-dropdown--account .header-dropdown-item--danger {
      color: var(--tm-error, #dc2626);
    }
    .header-dropdown.header-dropdown--account .header-dropdown-item--danger:hover {
      background: var(--tm-error-bg, #fef2f2);
      color: var(--tm-error, #dc2626);
    }
    .header-dropdown.header-dropdown--account .header-dropdown-item--danger .header-dropdown-item__icon {
      background: var(--tm-error-bg, #fef2f2);
      color: var(--tm-error, #dc2626);
    }
    .header-dropdown.header-dropdown--account .header-dropdown-item--danger:hover .header-dropdown-item__icon {
      background: var(--tm-error, #dc2626);
      color: #ffffff;
    }

    /* Dark mode overrides (token-aware; falls back to dark hex) */
    html.dark-mode .header-dropdown.header-dropdown--account,
    [data-theme="dark"] .header-dropdown.header-dropdown--account {
      background: var(--tm-bg-card, #111b2e);
      box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 1px 4px rgba(0, 0, 0, 0.3);
    }
    html.dark-mode .header-dropdown__profile,
    [data-theme="dark"] .header-dropdown__profile {
      background: linear-gradient(
        135deg,
        rgba(58, 136, 229, 0.15) 0%,
        var(--tm-bg-secondary, #111b2e) 100%
      );
    }
    
    /* Custom notification styles */
    .notification-item {
      padding: 0.75rem 1rem;
      border-bottom: 1px solid var(--tmv2-line-2);
      cursor: pointer;
      transition: background-color 0.15s ease;
    }
    .notification-item:hover {
      background-color: var(--tmv2-surface-2);
    }
    .notification-item.unread {
      background-color: var(--tmv2-primary-soft);
      border-left: 3px solid var(--color-primary);
    }
    .notification-icon {
      width: 36px;
      height: 36px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.1rem;
    }
    .notification-icon.order {
      background: var(--color-secondary-soft);
    }
    .notification-icon.profit {
      background: var(--tmv2-success-soft);
    }
    .notification-icon.alert {
      background: var(--tmv2-danger-soft);
    }
    
    /* Dropdown positioning fix */
    @media (max-width: 768px) {
      .header-dropdown {
        position: fixed !important;
        right: 10px !important;
        left: auto !important;
        top: auto !important;
        bottom: auto !important;
        width: calc(100vw - 20px) !important;
        max-width: 320px !important;
        transform-origin: top right !important;
      }
      
      .header-actions {
        position: relative;
      }
      
      .header-actions .dropdown {
        position: static;
      }
    }
    
    @media (max-width: 576px) {
      .header-dropdown {
        right: 10px !important;
        left: auto !important;
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
      }
    }
/* === Nasıl Yapılır / Kullanım rehberi modal (Bootstrap 5; backdrop body’de z~1050 — modal da body’ye taşınmalı) === */
#nasilYapilirModal.tmv2-guide-modal.modal {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#nasilYapilirModal .tmv2-guide-modal__dialog {
  width: min(1040px, 90vw) !important;
  max-width: min(1040px, 90vw) !important;
  margin: 2.5rem auto !important;
  max-height: calc(100vh - 64px);
}

@media (max-width: 576px) {
  #nasilYapilirModal .tmv2-guide-modal__dialog {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    margin: 0.75rem auto !important;
    max-height: calc(100vh - 24px);
  }
}

#nasilYapilirModal .tmv2-guide-modal__content {
  border-radius: 20px !important;
  border: 1px solid var(--tmv2-line, #e7ebf1) !important;
  background: var(--tmv2-surface, #ffffff) !important;
  box-shadow: var(--tmv2-sh-2, 0 12px 40px rgba(15, 23, 42, 0.1)) !important;
  overflow: hidden !important;
  max-height: calc(100vh - 64px) !important;
  display: flex !important;
  flex-direction: column !important;
}

@media (max-width: 576px) {
  #nasilYapilirModal .tmv2-guide-modal__content {
    border-radius: 14px !important;
    max-height: calc(100vh - 24px) !important;
  }
}

#nasilYapilirModal .tmv2-guide-modal__header {
  flex-shrink: 0;
  padding: 1rem 1.25rem !important;
  background: var(--tmv2-surface, #fff) !important;
  border-bottom-color: var(--tmv2-line-2, #eef1f6) !important;
}

#nasilYapilirModal .tmv2-guide-modal__header .modal-title {
  font-size: 1.125rem !important;
  color: var(--tmv2-ink, #0f172a) !important;
}

#nasilYapilirModal .tmv2-guide-modal__header-sub {
  font-size: 0.8125rem !important;
  color: var(--tmv2-ink-2, #475569) !important;
}

#nasilYapilirModal .tmv2-guide-modal__header-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  background: var(--tmv2-surface-2, #fafbfd);
  border: 1px solid var(--tmv2-line-2, #eef1f6);
}

#nasilYapilirModal .tmv2-guide-modal__close {
  opacity: 0.85;
  flex-shrink: 0;
}

#nasilYapilirModal .tmv2-guide-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none !important; /* tm-shell-v2 .modal-body 70vh üstünü kapat */
  overflow-y: auto !important;
  background: var(--tmv2-page, #f4f6fa) !important;
  -webkit-overflow-scrolling: touch;
}

#nasilYapilirModal .tmv2-guide-modal__quick {
  padding: 0.75rem 1.25rem !important;
  background: var(--tmv2-surface-2, #fafbfd) !important;
  border-bottom-color: var(--tmv2-line-2, #eef1f6) !important;
}

#nasilYapilirModal .tmv2-guide-modal__quick-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--tmv2-surface, #fff);
  border: 1px solid var(--tmv2-line, #e7ebf1);
  box-shadow: var(--tmv2-sh-1);
}

#nasilYapilirModal .tmv2-guide-modal__quick-icon span {
  font-size: 1.25rem;
  line-height: 1;
}

#nasilYapilirModal .tmv2-guide-modal__quick-title {
  font-size: 0.9375rem !important;
  color: var(--tmv2-ink, #0f172a) !important;
}

#nasilYapilirModal .tmv2-guide-modal__quick-text {
  color: var(--tmv2-ink-2, #475569) !important;
  line-height: 1.45;
}

/* Accordion — sadece bu modalda; hover’da kaydırma yok */
#nasilYapilirModal #tutorialAccordion {
  padding: 0.75rem !important;
}

#nasilYapilirModal #tutorialAccordion .accordion-button {
  padding: 0.65rem 0.85rem !important;
  min-height: 48px;
  align-items: center !important;
}

#nasilYapilirModal #tutorialAccordion .accordion-button:not(.collapsed) {
  background: var(--tmv2-primary-soft, #eff5ff) !important;
  color: var(--tmv2-primary-ink, #1d4ed8) !important;
  box-shadow: none !important;
}

#nasilYapilirModal #tutorialAccordion .accordion-button:focus {
  box-shadow: none !important;
  border-color: transparent !important;
}

#nasilYapilirModal #tutorialAccordion .accordion-button::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%232563eb'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e") !important;
  transition: transform 0.2s ease;
  margin-left: auto;
}

#nasilYapilirModal #tutorialAccordion .accordion-button.collapsed::after {
  transform: rotate(-90deg);
}

#nasilYapilirModal #tutorialAccordion .accordion-button:not(.collapsed)::after {
  transform: rotate(0deg);
}

#nasilYapilirModal #tutorialAccordion .accordion-item {
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

#nasilYapilirModal #tutorialAccordion .accordion-item:hover {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

#nasilYapilirModal #tutorialAccordion .accordion-collapse {
  transition: max-height 0.35s ease;
}
/* === Store seçim === */
.store-option-btn:hover {
    border-color: var(--tmv2-primary) !important;
    background: linear-gradient(135deg, var(--tmv2-surface-2) 0%, var(--tmv2-surface-3) 100%) !important;
    transform: translateY(-2px);
    box-shadow: var(--tmv2-sh-2) !important;
  }
  
  .store-option-btn:active {
    transform: translateY(0);
  }
  
  .store-option-btn .store-icon-wrapper {
    transition: transform 0.3s ease;
  }
  
  .store-option-btn:hover .store-icon-wrapper {
    transform: scale(1.1);
  }
/* === v2 üst şerit (reference-chrome birleşik) === */
/* ----- Üst şerit: başlık + arama (örnek .tmv2-header) ----- */
.tmv2-header--page {
  display: grid;
  grid-template-columns: minmax(160px, auto) minmax(200px, 1fr) auto;
  align-items: center;
  gap: 16px 24px;
  padding: 12px 20px 10px;
  border-bottom: 1px solid var(--tmv2-line-2);
  background: var(--tmv2-page);
  flex-shrink: 0;
}

.tmv2-head-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.tmv2-head-title h1 {
  margin: 0;
  font-family: var(--tmv2-ff-serif);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--tmv2-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tmv2-head-title .en {
  font-size: 13px;
  color: var(--tmv2-ink-2);
  font-family: var(--tmv2-ff-sans);
}

.tmv2-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 6px 0 12px;
  background: var(--tmv2-surface);
  border: 1px solid var(--tmv2-line);
  border-radius: 999px;
  box-shadow: var(--tmv2-sh-1);
  color: var(--tmv2-ink-2);
  font-size: 13px;
  max-width: 340px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tmv2-search:focus-within {
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb, 37, 99, 235), 0.14);
}

.tmv2-search__icon {
  flex-shrink: 0;
  color: var(--tmv2-ink-2);
}

.tmv2-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font: inherit;
  font-size: 13px;
  color: var(--tmv2-ink);
  min-width: 0;
}

/* Yerleşik (webkit/edge) arama temizle butonunu gizle — özel butonu kullanıyoruz */
.tmv2-search input[type="search"]::-webkit-search-cancel-button,
.tmv2-search input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.tmv2-search__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--tmv2-ink-2);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tmv2-search__clear:hover {
  background: var(--tmv2-line);
  color: var(--tmv2-ink);
}

.tmv2-search__clear[hidden] {
  display: none;
}

/* Typeahead öneri paneli — input'un altında açılır liste */
.tmv2-search__suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1080;
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 340px;
  overflow-y: auto;
  background: var(--tmv2-surface, #fff);
  border: 1px solid var(--tmv2-line, #e7ebf1);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.tmv2-search__suggest[hidden] {
  display: none;
}

.tmv2-search__suggest-group {
  padding: 6px 10px 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--tmv2-ink-2, #64748b);
}

.tmv2-search__suggest-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--tmv2-ink, #1e293b);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}

.tmv2-search__suggest-item__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tmv2-search__suggest-item__count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--tmv2-ink-2, #64748b);
  background: var(--tmv2-surface-2, #f1f5f9);
  border-radius: 999px;
  padding: 1px 7px;
}

.tmv2-search__suggest-item:hover,
.tmv2-search__suggest-item.is-active {
  background: var(--tmv2-surface-2, #f1f5f9);
}

.tmv2-search__suggest-item.is-active {
  outline: 1px solid var(--color-primary, #2563eb);
  outline-offset: -1px;
}

.tmv2-search__suggest-empty {
  padding: 10px;
  text-align: center;
  font-size: 13px;
  color: var(--tmv2-ink-2, #64748b);
}

html.dark-mode .tmv2-search__suggest {
  background: var(--color-surface, #1e293b);
  border-color: var(--tmv2-line, #334155);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

html.dark-mode .tmv2-header--page {
  background: var(--color-bg);
  border-bottom-color: var(--tmv2-line);
}

/* Tek şerit: başlık | arama (esnek) | sağ boşluk — referans yatay üst bar */
.tmv2-header--inline-in-bar {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(160px, 1fr) minmax(0, auto);
  flex: 1;
  min-width: 0;
  align-items: center;
  column-gap: 16px;
  row-gap: 8px;
  border-bottom: none !important;
  padding: 0 !important;
  background: transparent !important;
}

@media (max-width: 900px) {
  .tmv2-header--inline-in-bar {
    grid-template-columns: minmax(0, 1fr);
  }
}

.tmv2-header--inline-in-bar .tmv2-head-title,
.tmv2-header--inline-in-bar .tmv2-header-title-group {
  min-width: 0;
}

.tmv2-header--inline-in-bar .tmv2-search {
  max-width: 340px;
  width: 100%;
  margin: 0 !important;
  justify-self: stretch;
}

@media (min-width: 901px) {
  .tmv2-header--inline-in-bar .tmv2-search {
    justify-self: center;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

.tmv2-header--inline-in-bar .tmv2-head-right--placeholder {
  display: none;
}

/* Hide legacy logo section inside v2 header */
header.tmv2-header .header-logo-section {
  display: none !important;
}

/* V2 header: <header class="tmv2-header"> — styled in tm-shell-v2.css.
   No .header-wrapper/.header-bar inside v2 header — no legacy overrides needed. */

/* V2 header button styling */
header.tmv2-header .btn-nasil-yapilir {
  border-radius: 999px !important;
  padding: 6px 14px !important;
  font-size: 13px !important;
  gap: 6px !important;
  box-shadow: none !important;
  transform: none !important;
}

header.tmv2-header .btn-nasil-yapilir:hover {
  transform: translateY(-1px) !important;
  box-shadow: var(--tmv2-sh-1) !important;
}

#tmv2App .tmv2-header-outer .btn-nasil-yapilir-icon {
  width: 18px !important;
  height: 18px !important;
  font-size: 11px !important;
}

#tmv2App .tmv2-header-outer .header-dropdown-btn {
  border-radius: 10px !important;
  width: 40px !important;
  height: 40px !important;
  color: var(--tmv2-ink-2) !important;
}

#tmv2App .tmv2-header-outer .header-dropdown-btn:hover {
  background: var(--tmv2-surface-2) !important;
  color: var(--tmv2-ink) !important;
}

/* Tüm header icon button base — inline style'lar şablondan kaldırıldı, class kuralları artık geçerli.
   Boyut, renk, hover, focus, ikon size hep tek noktadan. */
.header-dropdown-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--tm-text-muted, #64748b);
  text-decoration: none;
  transition:
    background var(--tm-dur-1, .15s) var(--tm-ease, ease),
    color var(--tm-dur-1, .15s) var(--tm-ease, ease);
}
.header-dropdown-btn:hover {
  background: var(--tm-ink-100, #f1f5f9);
  color: var(--tm-text-primary, #0f172a);
}
.header-dropdown-btn:focus-visible {
  outline: none;
  box-shadow: var(--tm-ring);
}
/* Tüm lucide ikonları header butonlarda aynı boyutta */
.header-dropdown-btn > svg,
.header-dropdown-btn > i[data-lucide] {
  width: 20px !important;
  height: 20px !important;
  stroke-width: 2;
}
/* Badge — bildirim/sayı göstergesi */
.header-dropdown-btn__badge {
  font-size: 10px;
  font-weight: var(--tm-weight-semibold, 600);
  padding: 0.15em 0.4em;
  min-width: 18px;
  line-height: 1;
  background: var(--tm-brand-500, #0175e4);
  color: #fff;
  border: 2px solid var(--tm-surface, #fff);
  box-shadow: 0 2px 4px color-mix(in srgb, var(--tm-brand-500, #0175e4) 30%, transparent);
}
.header-dropdown-btn__badge--danger {
  background: var(--tm-bad, #dc2626);
  box-shadow: 0 2px 4px color-mix(in srgb, var(--tm-bad, #dc2626) 30%, transparent);
}
.header-dropdown-btn__badge[hidden] { display: none; }

/* Account avatar button */
.header-account-btn {
  border-radius: var(--tm-radius-full, 50%) !important;
  padding: 2px !important;
}
.header-account-btn:hover {
  background: transparent;
}
.header-account-btn__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tm-brand-500, #0175e4) 0%, var(--tm-brand-700, #014a94) 100%);
  border: 2px solid var(--tm-surface, #fff);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--tm-brand-500, #0175e4) 25%, transparent);
  transition: box-shadow var(--tm-dur-1, .15s) var(--tm-ease, ease);
  overflow: hidden;
}
.header-account-btn:hover .header-account-btn__avatar {
  box-shadow: 0 4px 12px color-mix(in srgb, var(--tm-brand-500, #0175e4) 35%, transparent);
}
.header-account-btn__avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.header-account-btn__avatar i[data-lucide],
.header-account-btn__avatar svg {
  width: 18px !important;
  height: 18px !important;
  color: #fff;
}

/* Dark mode ayarlamaları */
html.dark-mode .header-dropdown-btn {
  color: var(--tm-text-muted);
}
html.dark-mode .header-dropdown-btn:hover {
  background: color-mix(in srgb, var(--tm-text-primary) 8%, transparent);
  color: var(--tm-text-primary);
}
html.dark-mode .header-account-btn__avatar {
  border-color: var(--tm-surface);
}

@media (max-width: 768px) {
  #tmv2App .tmv2-header-outer .header-bar {
    padding: 8px 12px 8px !important;
  }
}

/* === v2 semantik sınıflar (header.html) === */
.tmv2-header-left {
  display: flex;
  align-items: baseline;
  min-width: 0;
}
.tmv2-header-title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.tmv2-header-title {
  margin: 0;
  /* Tema uyumu: v2 sans-serif (Inter) — sidebar, sayfa başlıkları ve butonlarla aynı aile.
     Eski Instrument Serif kaldırıldı; header metni gövde metni ile tutarlı. */
  font-family: var(--tmv2-ff-sans, "Inter", ui-sans-serif, system-ui, sans-serif);
  font-weight: var(--tmv2-fw-semibold, 600);
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  letter-spacing: -0.015em;
  color: var(--tmv2-ink, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.tmv2-header-subtitle {
  font-size: 13px;
  color: var(--tmv2-ink-2, #475569);
  font-family: var(--tmv2-ff-sans, "Inter", system-ui, sans-serif);
}
.tmv2-header-search {
  /* ek kurallar .tmv2-search ile */
}
#tmv2App .tmv2-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: nowrap;
  margin-left: auto;
}
@media (max-width: 768px) {
  #tmv2App .tmv2-header-actions {
    gap: 6px;
  }
}
.tmv2-header-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tmv2-ink-2, #475569);
  background: var(--tmv2-surface-2, #fafbfd);
  border: 1px solid var(--tmv2-line, #e7ebf1);
  white-space: nowrap;
}
.tmv2-header-status .tmv2-header-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tmv2-success);
  box-shadow: 0 0 0 3px rgba(var(--color-success-rgb), 0.25);
}

html.dark-mode .tmv2-header-status {
  background: var(--tmv2-surface-2, rgba(30, 41, 59, 0.6));
  border-color: var(--tmv2-line, #334155);
  color: var(--tmv2-ink-2, #94a3b8);
}
/* Geriye dönük: .tmv2-head-title */
.tmv2-head-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.tmv2-head-title h1 {
  margin: 0;
  font-family: var(--tmv2-ff-serif, "Instrument Serif", Georgia, serif);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--tmv2-ink, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tmv2-head-title .en {
  font-size: 13px;
  color: var(--tmv2-ink-2, #475569);
  font-family: var(--tmv2-ff-sans, "Inter", system-ui, sans-serif);
}
