/* ═══════════════════════════════════════════════════════════
   SEOGUM Layouts — v3.0
   Global shell (header, footer), page containers,
   navigation, filter bar, settings, grid systems.
   ═══════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════════
   0. DEMO BAR — .sg-demo-bar (sticky under header)
   ═══════════════════════════════════════════════════════════ */

.sg-demo-bar {
  position: sticky;
  top: var(--sg-nav-height);
  z-index: calc(var(--sg-z-sticky) - 1);
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-bottom: 1px solid rgba(99, 102, 241, 0.3);
}
.sg-demo-bar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: var(--sg-container-max);
  margin: 0 auto;
  padding: 6px var(--sg-container-pad);
}
.sg-demo-bar__icon {
  width: 14px;
  height: 14px;
  color: rgba(255,255,255,0.85);
  flex-shrink: 0;
}
.sg-demo-bar__text {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.95);
  letter-spacing: 0.01em;
}
.sg-demo-bar__btn {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #6366f1;
  background: #fff;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s;
}
.sg-demo-bar__btn:hover {
  background: #eef2ff;
  text-decoration: none;
}
@media (max-width: 640px) {
  .sg-demo-bar__text { font-size: 11px; }
  .sg-demo-bar__btn { padding: 3px 8px; font-size: 11px; }
}

/* ═══════════════════════════════════════════════════════════
   1. HEADER — .sg-header  (Brand-blue, right-aligned nav)
   ═══════════════════════════════════════════════════════════ */

.sg-header {
  position: sticky;
  top: 0;
  z-index: var(--sg-z-sticky);
  background: var(--sg-primary-600);
  border-bottom: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.sg-header__inner {
  display: flex;
  align-items: center;
  height: var(--sg-nav-height);
  max-width: var(--sg-container-max);
  margin: 0 auto;
  padding: 0 var(--sg-container-pad);
}

.sg-header__brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: var(--sg-space-4);
  text-decoration: none;
}
.sg-header__brand img {
  height: 20px;
  width: auto;
}

.sg-header__nav {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
  gap: var(--sg-space-1);
}

.sg-header__menu {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.sg-header__item {
  position: relative;
}

.sg-header .dropdown {
  position: relative;
}

/* Nav links — white on blue */
.sg-header .sg-header__link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: var(--sg-weight-medium);
  color: rgba(255, 255, 255, 0.78);
  border-radius: var(--sg-radius-md);
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--sg-transition-fast),
    color var(--sg-transition-fast);
}
.sg-header .sg-header__link:hover,
.sg-header .sg-header__link:focus {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
}
.sg-header .sg-header__link.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: var(--sg-weight-semibold);
  position: relative;
}
.sg-header .sg-header__link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

.sg-header__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sg-header__caret {
  width: 12px;
  height: 12px;
  opacity: 0.6;
  margin-left: -2px;
  transition: transform var(--sg-transition-fast);
}
.sg-header__item.open .sg-header__caret {
  transform: rotate(180deg);
}

/* Spacer hidden — nav uses justify-content: flex-end */
.sg-header__spacer {
  display: none;
}

.sg-header__right {
  display: flex;
  align-items: center;
  gap: var(--sg-space-1);
  margin-left: var(--sg-space-2);
}

/* Utility button (three-dot menu) */
.sg-header__util {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--sg-radius-md);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all var(--sg-transition-fast);
  padding: 0;
}
.sg-header__util:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.sg-header__util.active {
  background: rgba(255, 255, 255, 0.20);
  color: #fff;
}

/* Dropdown (white panel popping below the blue header) */
.sg-header .dropdown-menu {
  border: 1px solid var(--sg-neutral-200);
  border-radius: var(--sg-radius-lg) !important;
  box-shadow: var(--sg-shadow-dropdown);
  padding: var(--sg-space-1);
  min-width: 180px;
  margin-top: 4px;
  background: var(--sg-neutral-0);
  animation: sg-header-dd-in var(--sg-duration-fast) var(--sg-easing-default);
}
@keyframes sg-header-dd-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sg-header .sg-header__dd-item {
  display: flex;
  align-items: center;
  gap: var(--sg-space-2);
  padding: var(--sg-space-2) var(--sg-space-3);
  font-size: var(--sg-font-body);
  font-weight: var(--sg-weight-regular);
  color: var(--sg-neutral-700);
  border-radius: var(--sg-radius-md);
  text-decoration: none;
  transition: background var(--sg-transition-fast);
  white-space: nowrap;
}
.sg-header .sg-header__dd-item:hover,
.sg-header .sg-header__dd-item:focus {
  background: var(--sg-neutral-50);
  color: var(--sg-neutral-800);
  text-decoration: none;
}
.sg-header .sg-header__dd-item.active {
  background: var(--sg-primary-50);
  color: var(--sg-primary-600);
  font-weight: var(--sg-weight-medium);
}
.sg-header .sg-header__dd-item--danger {
  color: var(--sg-danger-600);
}
.sg-header .sg-header__dd-item--danger:hover {
  background: var(--sg-danger-50);
  color: var(--sg-danger-700);
}

.sg-header__dd-sep {
  height: 1px;
  background: var(--sg-neutral-100);
  margin: var(--sg-space-1) 0;
  list-style: none;
}

/* Account dropdown — user info card */
.sg-header__dd-account {
  min-width: 240px !important;
  padding: 6px !important;
}
.sg-header__dd-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 10px;
  list-style: none;
}
.sg-header__dd-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.sg-header__dd-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sg-header__dd-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--sg-neutral-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sg-header__dd-role {
  font-size: 11px;
  color: var(--sg-neutral-400);
  font-weight: 500;
}
.sg-header__dd-account .sg-header__dd-item {
  padding: 9px 12px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
}
.sg-header__dd-account .sg-header__dd-item svg {
  color: var(--sg-neutral-400);
  transition: color 0.15s;
}
.sg-header__dd-account .sg-header__dd-item:hover svg {
  color: var(--sg-primary-500);
}
.sg-header__dd-account .sg-header__dd-item--danger:hover svg {
  color: var(--sg-danger-600);
}

.sg-header__dd-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.sg-header__dd-dot--ai      { background: var(--sg-ai-500); }
.sg-header__dd-dot--danger   { background: var(--sg-danger-500); }
.sg-header__dd-dot--success  { background: var(--sg-success-500); }
.sg-header__dd-dot--primary  { background: var(--sg-primary-500); }

/* ── Mega Menu (anchor to trigger <li>, not viewport center) ── */
.sg-header__item.dropdown.sg-mega-parent {
  position: relative;
}
.sg-mega.dropdown-menu {
  left: auto !important;
  right: 0 !important;
  transform: none !important;
  min-width: 400px;
  max-width: min(620px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid var(--sg-neutral-100);
  border-radius: 18px !important;
  box-shadow: 0 25px 70px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
  margin-top: 8px;
  background: var(--sg-neutral-0);
  animation: sg-mega-in 0.25s cubic-bezier(.16,1,.3,1);
}
@keyframes sg-mega-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.sg-mega__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.sg-mega__grid--wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 400px;
  max-width: 600px;
}
/* İçerik mega menüsü: 3 sütun — Tanıtım Siteleri ile aynı sıkılıkta hissettirmek için 920px yerine sınırlı genişlik */
.sg-mega--content-xl.dropdown-menu {
  min-width: min(680px, calc(100vw - 24px));
  max-width: min(680px, calc(100vw - 24px));
}
.sg-mega__grid--cols3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
}
.sg-mega__grid--billing {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: min(520px, calc(100vw - 40px));
  gap: 6px;
}
/* Hesap menüsü (yalnızca alt bağlantılar) */
.sg-mega--account.dropdown-menu {
  min-width: 300px;
  max-width: min(400px, calc(100vw - 32px));
}
.sg-mega--account .sg-mega__footer {
  grid-template-columns: 1fr;
  border-top: none;
  margin-top: 0;
  padding-top: 2px;
}
.sg-mega__card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(.16,1,.3,1);
  color: var(--sg-neutral-700);
  border: 1px solid transparent;
  position: relative;
}
.sg-mega__card:hover {
  background: var(--sg-neutral-50);
  border-color: var(--sg-neutral-150, var(--sg-neutral-100));
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  text-decoration: none;
  color: var(--sg-neutral-800);
  transform: translateY(-1px);
}
.sg-mega__card:hover .sg-mega__card-icon {
  transform: scale(1.1);
  box-shadow: 0 4px 12px var(--_icon-shadow, rgba(0,0,0,.1));
}
.sg-mega__card:hover .sg-mega__card-text span {
  color: var(--sg-neutral-500);
}
.sg-mega__card.active {
  background: var(--sg-primary-50);
  border-color: rgba(99,102,241,.12);
}
.sg-mega__card.active .sg-mega__card-text strong {
  color: var(--sg-primary-600);
}
.sg-mega__card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(.16,1,.3,1), box-shadow 0.25s ease;
}
.sg-mega__card-icon svg {
  width: 20px;
  height: 20px;
}
.sg-mega__card-icon--tl svg {
  width: 26px;
  height: 26px;
}
.sg-mega__card-icon--tl text {
  font-size: 18px;
  font-weight: 800;
}
.sg-mega__card-icon--blue   { background: linear-gradient(135deg, rgba(28,130,255,.12), rgba(28,130,255,.06)); color: #1C82FF; --_icon-shadow: rgba(28,130,255,.2); }
.sg-mega__card-icon--violet { background: linear-gradient(135deg, rgba(139,92,246,.12), rgba(139,92,246,.06)); color: #8b5cf6; --_icon-shadow: rgba(139,92,246,.2); }
.sg-mega__card-icon--green  { background: linear-gradient(135deg, rgba(16,185,129,.12), rgba(16,185,129,.06)); color: #10b981; --_icon-shadow: rgba(16,185,129,.2); }
.sg-mega__card-icon--red    { background: linear-gradient(135deg, rgba(239,68,68,.12), rgba(239,68,68,.06));   color: #ef4444; --_icon-shadow: rgba(239,68,68,.2); }
.sg-mega__card-icon--amber  { background: linear-gradient(135deg, rgba(245,158,11,.12), rgba(245,158,11,.06)); color: #f59e0b; --_icon-shadow: rgba(245,158,11,.2); }
.sg-mega__card-icon--cyan   { background: linear-gradient(135deg, rgba(6,182,212,.12), rgba(6,182,212,.06));   color: #06b6d4; --_icon-shadow: rgba(6,182,212,.2); }
.sg-mega__card-icon--rose   { background: linear-gradient(135deg, rgba(244,63,94,.12), rgba(244,63,94,.06));   color: #f43f5e; --_icon-shadow: rgba(244,63,94,.2); }
.sg-mega__card-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding-top: 2px;
}
.sg-mega__card-text strong {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--sg-neutral-800);
  line-height: 1.3;
}
.sg-mega__card-text span {
  font-size: 12px;
  color: var(--sg-neutral-400);
  line-height: 1.4;
  transition: color 0.2s;
}

/* dropdown-menu içindeki <a> — :focus/:active sonrası kalan alt çizgiyi kaldır */
a.sg-mega__card,
a.sg-mega__card:visited,
a.sg-mega__card:hover,
a.sg-mega__card:focus,
a.sg-mega__card:focus-visible,
a.sg-mega__card:focus-within,
a.sg-mega__card:active {
  text-decoration: none !important;
  -webkit-tap-highlight-color: transparent;
}
a.sg-mega__card .sg-mega__card-text,
a.sg-mega__card .sg-mega__card-text strong,
a.sg-mega__card .sg-mega__card-text span {
  text-decoration: none !important;
}

/* Mega kart: kilit rozeti yalnızca üst paket kısıtı varken */
.sg-mega__card:not(.sg-mega__card--premium-lock) .sg-mega__card-lock-wrap {
  display: none;
}
.sg-mega__card-lock-wrap {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  line-height: 0;
}
.sg-mega__card-lock-wrap .sg-tipsy.sg-tipsy--lock {
  margin-left: 0;
  width: 22px;
  height: 22px;
  font-size: 10px;
}

.sg-mega__card--premium-lock {
  cursor: not-allowed;
  color: var(--sg-neutral-500);
}
.sg-mega__card--premium-lock .sg-mega__card-text strong {
  color: var(--sg-neutral-400);
}
.sg-mega__card--premium-lock .sg-mega__card-text span {
  color: var(--sg-neutral-300);
}
.sg-mega__card--premium-lock .sg-mega__card-icon {
  opacity: 0.5;
  filter: grayscale(0.45);
}
.sg-mega__card--premium-lock:hover {
  transform: none;
  background: var(--sg-neutral-50);
  border-color: var(--sg-neutral-150, var(--sg-neutral-100));
  box-shadow: none;
  color: var(--sg-neutral-500);
}
.sg-mega__card--premium-lock:hover .sg-mega__card-icon {
  transform: none;
  box-shadow: none;
}
.sg-mega__card--premium-lock:hover .sg-mega__card-text span {
  color: var(--sg-neutral-400);
}

/* Üst menü Raporlar: kilit yalnızca kilitliyken; mavi zeminde açık ton (gri değil) */
.sg-header__nav-lock-tip {
  display: none;
}
.sg-header__link--premium-lock .sg-header__nav-lock-tip {
  display: inline-flex;
}
.sg-header__link--premium-lock {
  color: rgba(255, 255, 255, 0.58);
}
.sg-header__link--premium-lock:hover,
.sg-header__link--premium-lock:focus {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
}
.sg-header__link--premium-lock .sg-header__nav-lock-tip.sg-tipsy {
  margin-left: 4px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.sg-header__link--premium-lock .sg-header__nav-lock-tip.sg-tipsy:hover {
  background: rgba(255, 255, 255, 0.36);
  color: #fff;
  transform: scale(1.06);
}

.sg-header__premium-ico {
  display: none !important;
}

.sg-header__right .dropdown.sg-mega-parent {
  position: relative;
}
.sg-mega--right.dropdown-menu {
  left: auto !important;
  right: 0 !important;
  transform: none !important;
}
@keyframes sg-mega-right-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sg-mega--right.dropdown-menu {
  animation: sg-mega-right-in 0.25s cubic-bezier(.16,1,.3,1);
}
.sg-mega__header {
  padding: 6px 16px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sg-mega__header-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sg-neutral-400);
  flex: 1;
}
.sg-mega__section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sg-neutral-400);
  padding: 4px 16px 8px 16px;
}
.sg-mega__footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-top: 1px solid var(--sg-neutral-100);
  padding: 10px 4px 0 4px;
  margin-top: 6px;
}
.sg-mega__footer-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sg-neutral-700);
  text-decoration: none;
  padding: 12px 12px;
  border-radius: 14px;
  transition: all 0.2s cubic-bezier(.16,1,.3,1);
  border: 1px solid transparent;
}
.sg-mega__footer-link:hover {
  background: var(--sg-neutral-50);
  border-color: var(--sg-neutral-150, var(--sg-neutral-100));
  color: var(--sg-neutral-900);
  text-decoration: none;
  transform: translateY(-1px);
}
.sg-mega__footer-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(28, 130, 255, 0.1);
  color: var(--sg-primary-600);
  transition: transform 0.25s cubic-bezier(.16,1,.3,1), box-shadow 0.25s;
}
.sg-mega__footer-link:hover .sg-mega__footer-icon {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(28,130,255,.15);
}
.sg-mega__footer-icon svg {
  width: 22px;
  height: 22px;
}
.sg-mega__footer-icon--danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--sg-danger-600);
}
.sg-mega__footer-link:hover .sg-mega__footer-icon--danger {
  box-shadow: 0 4px 12px rgba(239,68,68,.15);
}
.sg-mega__footer-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-top: 2px;
}
.sg-mega__footer-text strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}
.sg-mega__footer-text span {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--sg-neutral-400);
  line-height: 1.3;
}
.sg-mega__footer-url {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--sg-neutral-400);
  letter-spacing: 0.02em;
  line-height: 1.3;
  word-break: break-all;
}
.sg-mega__footer-link:hover .sg-mega__footer-url {
  color: var(--sg-neutral-500);
}
.sg-mega__footer-link--danger {
  color: var(--sg-danger-600);
}
.sg-mega__footer-link--danger:hover {
  background: var(--sg-danger-50);
  color: var(--sg-danger-700);
}
.sg-mega__footer-link--danger .sg-mega__footer-text span {
  color: var(--sg-danger-400);
}

/* Mobile toggle — white on blue */
.sg-header__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  border-radius: var(--sg-radius-md);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  flex-shrink: 0;
}
.sg-header__toggle svg {
  width: 20px;
  height: 20px;
}
.sg-header__toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.sg-header__toggle.is-open {
  background: rgba(255, 255, 255, 0.20);
  color: #fff;
}


/* ═══════════════════════════════════════════════════════════
   2. FOOTER — .sg-footer
   ═══════════════════════════════════════════════════════════ */

.sg-footer {
  margin-top: var(--sg-space-12);
  padding: var(--sg-space-5) 0;
  border-top: 1px solid var(--sg-neutral-100);
}

.sg-footer__inner {
  max-width: var(--sg-container-max);
  margin: 0 auto;
  padding: 0 var(--sg-container-pad);
  text-align: center;
  font-size: var(--sg-font-caption);
  color: var(--sg-neutral-400);
}


/* ═══════════════════════════════════════════════════════════
   3. PAGE CONTAINER — .sg-page
   ═══════════════════════════════════════════════════════════ */

.sg-page {
  max-width: var(--sg-container-max);
  margin: 0 auto;
  padding:
    var(--sg-space-8)
    var(--sg-container-pad);
}

.sg-page--narrow {
  max-width: 800px;
}

.sg-page--wide {
  max-width: 1440px;
}


/* ═══════════════════════════════════════════════════════════
   4. PAGE HEADER — .sg-page-header
   ═══════════════════════════════════════════════════════════ */

.sg-page-header {
  margin-bottom: var(--sg-space-6);
}

.sg-page-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sg-space-4);
  flex-wrap: wrap;
}

.sg-page-header__title-row {
  display: flex;
  align-items: center;
  gap: var(--sg-space-2);
}

.sg-page-header__title {
  font-size: var(--sg-font-h1);
  font-weight: var(--sg-weight-bold);
  color: var(--sg-neutral-900);
  letter-spacing: var(--sg-tracking-tight);
  margin: 0;
}

.sg-page-header__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 var(--sg-space-2);
  font-size: var(--sg-font-caption);
  font-weight: var(--sg-weight-bold);
  color: var(--sg-neutral-500);
  background: var(--sg-neutral-100);
  border-radius: var(--sg-radius-full);
}

.sg-page-header__subtitle {
  font-size: var(--sg-font-body);
  color: var(--sg-neutral-500);
  margin: var(--sg-space-1) 0 0;
}

.sg-page-header__actions {
  display: flex;
  align-items: center;
  gap: var(--sg-space-2);
}


/* ═══════════════════════════════════════════════════════════
   5. TOOLBAR / FILTER BAR — .sg-toolbar, .sg-filter-bar
   ═══════════════════════════════════════════════════════════ */

.sg-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sg-space-3);
  padding: 6px;
  background: var(--sg-neutral-0);
  border: 1px solid var(--sg-neutral-200);
  border-radius: var(--sg-radius-lg);
  margin-bottom: var(--sg-space-6);
  box-shadow: var(--sg-shadow-xs);
}

/* Toolbar form layout */
.sg-toolbar__form {
  display: flex;
  align-items: center;
  gap: var(--sg-space-3);
  width: 100%;
  flex-wrap: wrap;
}
.sg-toolbar__form > select.sg-input {
  width: auto;
  min-width: 160px;
  flex: 0 0 auto;
}
/* Tom Select sarmalayıcısı — eski > select ile aynı yerleşim (çift kutu hizası) */
.sg-toolbar__form > .ts-wrapper {
  width: auto;
  min-width: 160px;
  flex: 0 0 auto;
}
/* Dar filtre alanı (Tom Select kardeşi slot içinde kalır) */
.sg-toolbar__select-slot {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
}
.sg-toolbar__select-slot .ts-wrapper {
  max-width: 100%;
}
.sg-toolbar__form > .sg-field {
  margin: 0;
}

.sg-toolbar__search {
  position: relative;
  flex: 1;
  min-width: 180px;
}
.sg-toolbar__search .sg-input {
  border-color: transparent;
  background: var(--sg-neutral-50);
  height: 36px;
  font-size: 13px;
  border-radius: var(--sg-radius-md);
  padding-left: 34px;
}
.sg-toolbar__search .sg-input:hover {
  border-color: var(--sg-neutral-300);
}
.sg-toolbar__search .sg-input:focus {
  background: var(--sg-neutral-0);
  border-color: var(--sg-primary-500);
}
.sg-toolbar__search-icon,
.sg-toolbar__search .sg-input-search__icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--sg-neutral-400);
  pointer-events: none;
  flex-shrink: 0;
}

.sg-toolbar__field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--sg-neutral-600);
  white-space: nowrap;
  margin: 0;
}
.sg-toolbar__form--logs-filter {
  align-items: center;
  flex-wrap: wrap;
}

.sg-toolbar__controls {
  display: flex;
  align-items: center;
  gap: var(--sg-space-2);
  flex-shrink: 0;
}

.sg-toolbar .sg-segment {
  padding: 3px;
}
.sg-toolbar .sg-btn--sm {
  height: 36px;
}

/* Legacy filter bar (kept for compatibility) */
.sg-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--sg-space-3);
  flex-wrap: wrap;
  margin-bottom: var(--sg-space-6);
}

.sg-filter-bar__group {
  display: flex;
  align-items: center;
  gap: var(--sg-space-2);
}

.sg-filter-bar__search {
  flex: 1;
  min-width: 200px;
}

.sg-filter-bar__label {
  font-size: var(--sg-font-label);
  color: var(--sg-neutral-500);
  font-weight: var(--sg-weight-medium);
  white-space: nowrap;
}

/* Pill filter buttons */
.sg-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sg-space-1);
  height: 32px;
  padding: 0 var(--sg-space-3);
  font-family: var(--sg-font-family);
  font-size: 13px;
  font-weight: var(--sg-weight-regular);
  color: var(--sg-neutral-700);
  background: var(--sg-neutral-0);
  border: 1px solid var(--sg-neutral-300);
  border-radius: var(--sg-radius-full);
  cursor: pointer;
  transition:
    background var(--sg-transition-fast),
    border-color var(--sg-transition-fast),
    color var(--sg-transition-fast);
}
.sg-filter-pill:hover {
  background: var(--sg-neutral-50);
  border-color: var(--sg-neutral-400);
}
.sg-filter-pill.is-active {
  background: var(--sg-primary-50);
  border-color: var(--sg-primary-200);
  color: var(--sg-primary-600);
  font-weight: var(--sg-weight-medium);
}
.sg-filter-pill__count {
  font-size: var(--sg-font-caption);
  font-weight: var(--sg-weight-semibold);
  color: var(--sg-neutral-400);
  margin-left: 2px;
}
.sg-filter-pill.is-active .sg-filter-pill__count { color: var(--sg-primary-500); }


/* ═══════════════════════════════════════════════════════════
   6. SETTINGS LAYOUT — .sg-settings
   ═══════════════════════════════════════════════════════════ */

.sg-settings {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--sg-space-8);
  align-items: start;
}

.sg-settings__nav {
  position: sticky;
  top: calc(var(--sg-nav-height) + var(--sg-space-6));
  display: flex;
  flex-direction: column;
  gap: var(--sg-space-1);
}

.sg-settings__nav-item {
  display: flex;
  align-items: center;
  gap: var(--sg-space-2);
  padding: var(--sg-space-2) var(--sg-space-3);
  font-size: var(--sg-font-body);
  font-weight: var(--sg-weight-regular);
  color: var(--sg-neutral-600);
  border-radius: var(--sg-radius-md);
  text-decoration: none;
  transition:
    background var(--sg-transition-fast),
    color var(--sg-transition-fast);
}
.sg-settings__nav-item:hover {
  background: var(--sg-neutral-100);
  color: var(--sg-neutral-800);
  text-decoration: none;
}
.sg-settings__nav-item.is-active {
  background: var(--sg-primary-50);
  color: var(--sg-primary-600);
  font-weight: var(--sg-weight-medium);
}
.sg-settings__nav-item svg { width: 16px; height: 16px; }

.sg-settings__content {
  min-width: 0;
}


/* ═══════════════════════════════════════════════════════════
   7. GRID SYSTEMS
   ═══════════════════════════════════════════════════════════ */

.sg-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sg-space-4);
  margin-bottom: var(--sg-space-6);
}

/* Dashboard KPI strip — equal-sized cards */
.sg-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sg-space-4);
  margin-bottom: var(--sg-space-6);
}
.sg-kpi-card {
  background: var(--sg-neutral-0);
  border: 1px solid var(--sg-neutral-150, var(--sg-neutral-200));
  border-radius: var(--sg-radius-lg);
  padding: var(--sg-space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--sg-space-4);
  box-shadow: var(--sg-shadow-xs);
  transition: box-shadow var(--sg-transition-fast), border-color var(--sg-transition-fast), transform var(--sg-transition-fast);
  position: relative;
  overflow: hidden;
}
.sg-kpi-card:hover {
  box-shadow: var(--sg-shadow-sm);
  border-color: var(--sg-neutral-300);
  transform: translateY(-2px);
}
.sg-kpi-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--sg-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
  overflow: hidden;
}
.sg-kpi-card__icon svg {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}
.sg-kpi-card__icon--blue    { background: var(--sg-primary-50);  color: var(--sg-primary-500); }
.sg-kpi-card__icon--violet  { background: var(--sg-ai-50);      color: var(--sg-ai-500); }
.sg-kpi-card__icon--amber   { background: var(--sg-warning-50); color: var(--sg-warning-600); }
.sg-kpi-card__icon--emerald { background: var(--sg-success-50); color: var(--sg-success-600); }
.sg-kpi-card__icon--danger  { background: var(--sg-danger-50);  color: var(--sg-danger-500); }

.sg-kpi-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sg-kpi-card__value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--sg-neutral-900);
  letter-spacing: -0.02em;
}
.sg-kpi-card__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--sg-neutral-500);
}
.sg-kpi-card:has(.sg-kpi-card__sub) {
  padding-bottom: 36px;
}
.sg-kpi-card__sub {
  position: absolute;
  bottom: 10px;
  left: var(--sg-space-5);
  right: var(--sg-space-5);
  font-size: 11px;
  color: var(--sg-neutral-400);
  border-top: 1px solid var(--sg-neutral-100);
  padding-top: 8px;
}

.sg-insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sg-space-4);
  margin-bottom: var(--sg-space-6);
}
.sg-insight-grid > .sg-insight:first-child {
  grid-column: 1 / -1;
}

.sg-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sg-space-4);
  margin-bottom: var(--sg-space-6);
}

.sg-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sg-space-4); }
.sg-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sg-space-4); }
.sg-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sg-space-4); }

.sg-section { margin-bottom: var(--sg-space-8); }
.sg-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sg-space-4);
  margin-bottom: var(--sg-space-4);
}
.sg-section__title {
  font-size: var(--sg-font-h3);
  font-weight: var(--sg-weight-semibold);
  color: var(--sg-neutral-800);
  margin: 0;
}
.sg-section__link {
  font-size: var(--sg-font-label);
  font-weight: var(--sg-weight-medium);
  color: var(--sg-primary-600);
  text-decoration: none;
}
.sg-section__link:hover { text-decoration: underline; }


/* ═══════════════════════════════════════════════════════════
   8. FORM CARD — .sg-form-card
   ═══════════════════════════════════════════════════════════ */

.sg-form-card {
  position: relative;
  background: var(--sg-neutral-0);
  border: 1px solid var(--sg-neutral-200);
  border-radius: var(--sg-radius-lg);
  box-shadow: var(--sg-shadow-xs);
  /* overflow: visible — tooltip / dropdown üstten kesilmesin (önceden hidden idi) */
  overflow: visible;
}

.sg-form-card__header {
  padding: var(--sg-space-5) var(--sg-space-6);
  border-bottom: 1px solid var(--sg-neutral-100);
}
.sg-form-card__title {
  font-size: var(--sg-font-h3);
  font-weight: var(--sg-weight-semibold);
  color: var(--sg-neutral-800);
  margin: 0;
}
.sg-form-card__desc {
  font-size: 13px;
  color: var(--sg-neutral-500);
  margin: var(--sg-space-1) 0 0;
}

.sg-form-card__body {
  padding: var(--sg-space-6);
}

.sg-form-section {
  margin-bottom: var(--sg-space-6);
  padding-bottom: var(--sg-space-6);
  border-bottom: 1px solid var(--sg-neutral-100);
}
.sg-form-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.sg-form-section__title {
  font-size: 13px;
  font-weight: var(--sg-weight-semibold);
  color: var(--sg-neutral-700);
  margin: 0 0 var(--sg-space-4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sg-form-row {
  display: flex;
  gap: var(--sg-space-4);
}
.sg-form-row > .sg-field { flex: 1; min-width: 0; }
.sg-form-row--3 { display: flex; gap: var(--sg-space-4); }
.sg-form-row--3 > .sg-field { flex: 1; min-width: 0; }
.sg-form-row--4 { display: flex; gap: var(--sg-space-3); }
.sg-form-row--4 > .sg-field { flex: 1; min-width: 0; }

.sg-form-card__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sg-space-3);
  padding: var(--sg-space-4) var(--sg-space-6);
  border-top: 1px solid var(--sg-neutral-200);
  background: var(--sg-neutral-50);
}
.sg-form-card__footer.has-changes {
  background: var(--sg-primary-50);
}
.sg-form-card__footer .sg-unsaved-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sg-primary-500);
  margin-right: var(--sg-space-2);
}

/* Consecutive cards spacing */
.sg-form-card + .sg-form-card {
  margin-top: var(--sg-space-5);
}

/* Header with right-side action (e.g. button) */
.sg-form-card__header--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sg-space-3);
  flex-wrap: wrap;
}

/* Inline status message inside card body */
.sg-form-card__status {
  display: block;
  font-size: var(--sg-font-caption);
  font-weight: var(--sg-weight-medium);
  color: var(--sg-neutral-500);
  padding: var(--sg-space-2) 0 var(--sg-space-3);
  border-bottom: 1px solid var(--sg-neutral-100);
  margin-bottom: var(--sg-space-4);
}
.sg-form-card__status--success { color: var(--sg-success-600); }
.sg-form-card__status--error   { color: var(--sg-danger-600); }

/* Standalone form action bar (below all cards) */
.sg-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sg-space-3);
  padding: var(--sg-space-6) 0 var(--sg-space-2);
}


/* ═══════════════════════════════════════════════════════════
   9. RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

/* Narrow screens: collapse nav labels, keep icons */
@media (max-width: 1100px) {
  .sg-header__label { display: none; }
  .sg-header .sg-header__link { padding: 6px 8px; }
}

/* Tablet */
@media (max-width: 1024px) {
  .sg-settings {
    grid-template-columns: 1fr;
  }
  .sg-settings__nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: var(--sg-space-2);
    padding-bottom: var(--sg-space-4);
    border-bottom: 1px solid var(--sg-neutral-200);
  }
  .sg-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
  .sg-kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 767px) {
  /* Header mobile */
  .sg-header__toggle {
    display: flex;
  }
  .sg-header__nav {
    display: none;
    position: absolute;
    top: var(--sg-nav-height);
    left: 0;
    right: 0;
    background: var(--sg-primary-700);
    border-bottom: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    padding: var(--sg-space-3) var(--sg-container-pad) var(--sg-space-4);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    z-index: var(--sg-z-dropdown);
    max-height: calc(100vh - var(--sg-nav-height));
    overflow-y: auto;
  }
  .sg-header__nav.is-open {
    display: flex;
  }
  .sg-header__menu {
    flex-direction: column;
    gap: 2px;
    width: 100%;
  }
  .sg-header .sg-header__link {
    width: 100%;
    padding: 10px 12px;
  }
  .sg-header .sg-header__link.active::after {
    display: none;
  }
  .sg-header__label {
    display: inline;
  }
  .sg-header__right {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: var(--sg-space-3);
    margin-top: var(--sg-space-2);
    margin-left: 0;
    width: 100%;
  }
  /* Inline dropdowns on mobile — blend with blue nav */
  .sg-header .dropdown-menu {
    position: static !important;
    float: none !important;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 0 var(--sg-space-6);
    margin: 0;
    animation: none;
    width: 100%;
  }
  /* Mega menu mobile override */
  .sg-mega-parent { position: relative !important; }
  .sg-mega.dropdown-menu {
    position: static !important;
    transform: none;
    left: auto !important;
    min-width: 0;
    max-width: none;
    border-radius: 0 !important;
    border: none;
    box-shadow: none;
    background: transparent;
    padding: var(--sg-space-1) 0 var(--sg-space-1) var(--sg-space-4);
    animation: none;
  }
  .sg-mega__grid,
  .sg-mega__grid--wide,
  .sg-mega__grid--cols3 {
    grid-template-columns: 1fr;
    min-width: 0;
    gap: 2px;
  }
  .sg-mega__card {
    padding: 8px 10px;
    border-radius: 8px;
    gap: 10px;
    border-color: transparent;
  }
  .sg-mega__card:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: transparent;
    box-shadow: none;
    transform: none;
  }
  .sg-mega__card.active {
    background: rgba(255, 255, 255, 0.15);
  }
  a.sg-mega__card,
  a.sg-mega__card:focus,
  a.sg-mega__card:active {
    text-decoration: none !important;
  }
  a.sg-mega__card .sg-mega__card-text strong,
  a.sg-mega__card .sg-mega__card-text span {
    text-decoration: none !important;
  }
  .sg-mega__card-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255,255,255,.12) !important;
    color: #fff !important;
  }
  .sg-mega__card:hover .sg-mega__card-icon { transform: none; box-shadow: none; }
  .sg-mega__card-icon svg { width: 15px; height: 15px; }
  .sg-mega__card-icon--tl svg { width: 22px; height: 22px; }
  .sg-mega__card-icon--tl text { font-size: 16px; }
  .sg-mega__card-text strong { color: rgba(255,255,255,.9); font-size: 12px; }
  .sg-mega__card-text span { color: rgba(255,255,255,.5); font-size: 10px; }
  .sg-mega__card--premium-lock .sg-mega__card-text strong { color: rgba(255,255,255,.42); }
  .sg-mega__card--premium-lock .sg-mega__card-text span { color: rgba(255,255,255,.32); }
  .sg-mega__card--premium-lock .sg-mega__card-icon { opacity: 0.42; filter: grayscale(0.35); }
  .sg-mega__card-lock-wrap .sg-tipsy.sg-tipsy--premium {
    background: rgba(255,255,255,.2);
    color: #fff;
    box-shadow: none;
  }
  .sg-mega__card-lock-wrap .sg-tipsy.sg-tipsy--premium:hover {
    background: rgba(255,255,255,.32);
    color: #fff;
  }
  .sg-mega__header { padding: 2px 10px 6px; }
  .sg-mega__header-label { color: rgba(255,255,255,.4); font-size: 10px; }
  .sg-mega__section-label { color: rgba(255,255,255,.4); padding: 0 10px 4px; }
  .sg-mega__footer { grid-template-columns: 1fr; border-color: rgba(255,255,255,.12); padding: 8px 0 0; margin-top: 4px; }
  .sg-mega__footer-link { color: rgba(255,255,255,.85); }
  .sg-mega__footer-link:hover { color: #fff; background: rgba(255,255,255,.08); }
  .sg-mega__footer-icon { background: rgba(255,255,255,.12) !important; color: #fff !important; }
  .sg-mega__footer-text strong { color: rgba(255,255,255,.95); }
  .sg-mega__footer-text span { color: rgba(255,255,255,.45); }
  .sg-mega__footer-url { color: rgba(255,255,255,.38) !important; font-size: 9px; }
  .sg-mega__footer-link--danger { color: rgba(255,160,160,.95); }
  .sg-mega__footer-link--danger:hover { color: #fff; }
  .sg-header .sg-header__dd-item {
    color: rgba(255, 255, 255, 0.75);
  }
  .sg-header .sg-header__dd-item:hover,
  .sg-header .sg-header__dd-item:focus {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
  }
  .sg-header .sg-header__dd-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
  }
  .sg-header .sg-header__dd-item--danger {
    color: rgba(255, 120, 120, 0.9);
  }
  .sg-header .sg-header__dd-item--danger:hover {
    background: rgba(255, 80, 80, 0.15);
    color: var(--sg-danger-400);
  }
  .sg-header__dd-sep {
    background: rgba(255, 255, 255, 0.12);
  }
  .sg-header__dd-account {
    background: var(--sg-neutral-900, #1e293b) !important;
    border-color: rgba(255,255,255,0.1) !important;
  }
  .sg-header__dd-name { color: #fff; }
  .sg-header__dd-role { color: rgba(255,255,255,0.45); }
  .sg-header__dd-account .sg-header__dd-item svg { color: rgba(255,255,255,0.4); }

  /* Page */
  .sg-page {
    padding: var(--sg-space-5) var(--sg-space-4);
  }
  .sg-page-header__top {
    flex-direction: column;
    align-items: flex-start;
  }
  .sg-page-header__title {
    font-size: var(--sg-font-h2);
  }

  /* Footer — already centered, no mobile override needed */

  /* Grids */
  .sg-kpi-grid { grid-template-columns: 1fr; }
  .sg-kpi-strip { grid-template-columns: 1fr 1fr; }
  .sg-kpi-card__sub { position: static; border-top: 1px solid var(--sg-neutral-100); padding-top: 6px; margin-top: 8px; }
  .sg-insight-grid { grid-template-columns: 1fr; }
  .sg-grid-2,
  .sg-grid-3,
  .sg-grid-4 { grid-template-columns: 1fr; }
  .sg-form-row { flex-direction: column; }
  .sg-form-row--3 { flex-direction: column; }
  .sg-form-row--4 { flex-wrap: wrap; }
  .sg-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sg-space-2);
    padding: var(--sg-space-2);
  }
  .sg-toolbar__form {
    flex-direction: column;
    align-items: stretch;
  }
  .sg-toolbar__controls {
    justify-content: space-between;
  }
  .sg-filter-bar { flex-direction: column; align-items: stretch; }
  .sg-filter-bar__search { max-width: none; }
  .sg-empty__features { grid-template-columns: 1fr; }
}
