/* ─────────────────────────────────────────────────────────────────────────
 * Zyron CRM — Google Entegrasyonları (Settings paneli + Site Traffic kartları)
 *
 *   · Settings > Entegrasyonlar > Google panel (oturum aç, servis listeleri,
 *     sync history, kurulum rehberi)
 *   · Site Trafik sayfasındaki GA4 / Search Console / Merchant kart panelleri
 *
 * Tema değişkenlerine bağlıdır (var(--st-*)); /css/pages/site-traffic.css'in
 * üstünde çalışacak ek class'lar.
 * ───────────────────────────────────────────────────────────────────────── */

.g-hidden { display: none !important; }

/* ─── Settings panel ────────────────────────────────────────────────────── */
.g-integ {
  --g-border: rgba(255,255,255,0.08);
  --g-surface: rgba(255,255,255,0.025);
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 16px;
}
[data-theme="light"] .g-integ {
  --g-border: rgba(15,23,42,0.1);
  --g-surface: rgba(15,23,42,0.025);
}

.g-integ__status {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(66,133,244,0.06), rgba(234,67,53,0.04));
  border: 1px solid var(--g-border);
  border-radius: 12px;
  flex-wrap: wrap;
}
.g-integ__status-left {
  display: flex; align-items: center; gap: 14px;
  min-width: 0; flex: 1;
}
.g-integ__status-right {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.g-integ__logo {
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff;
  border-radius: 10px;
  flex-shrink: 0;
}
.g-integ__title {
  font-size: 15px; font-weight: 700;
}
.g-integ__sub {
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.g-integ__hint {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  background: rgba(59,130,246,0.06);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 10px;
  font-size: 13px;
}
.g-integ__hint i {
  font-size: 18px; color: #60a5fa; flex-shrink: 0; margin-top: 1px;
}
.g-integ__hint p { margin: 4px 0 0 0; color: var(--color-text-muted); }
.g-integ__hint a { color: var(--color-primary, #D7263D); font-weight: 600; }
.g-integ__hint--warn {
  background: rgba(245,158,11,0.06);
  border-color: rgba(245,158,11,0.25);
}
.g-integ__hint--warn i { color: #f59e0b; }

.g-integ__section {
  background: var(--g-surface);
  border: 1px solid var(--g-border);
  border-radius: 10px;
  overflow: hidden;
}
.g-integ__section > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 13.5px;
  user-select: none;
}
.g-integ__section > summary::-webkit-details-marker { display: none; }
.g-integ__section > summary::after {
  content: '\203A';
  margin-left: auto;
  transition: transform 0.2s;
  font-size: 18px;
  color: var(--color-text-muted);
}
.g-integ__section[open] > summary::after { transform: rotate(90deg); }
.g-integ__section > summary i {
  font-size: 17px;
  color: var(--color-primary, #D7263D);
}
.g-integ__body {
  padding: 14px 16px 16px 16px;
  border-top: 1px solid var(--g-border);
}

/* Per-service status dot in summary */
.g-svc__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #6b7280;
  display: inline-block;
  flex-shrink: 0;
}
.g-svc__dot.is-ok   { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,0.18); }
.g-svc__dot.is-warn { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.18); }
.g-svc__dot.is-err  { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.18); }
.g-svc__dot.is-off  { background: #6b7280; }

.g-svc__meta {
  margin-left: auto;
  margin-right: 16px;
  font-size: 11.5px;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Sites dropdown */
.g-sites-dropdown {
  margin-top: 8px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--g-border);
  border-radius: 8px;
  background: var(--color-surface-1, #1a1a1d);
}
.g-sites-dropdown__item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--g-border);
  font-size: 12.5px;
  transition: background 0.15s;
}
.g-sites-dropdown__item:last-child { border-bottom: 0; }
.g-sites-dropdown__item:hover { background: rgba(255,255,255,0.04); }

/* Sync history list */
.g-sync-history {
  font-size: 13px;
}
.g-sync-jobs { list-style: none; margin: 0; padding: 0; }
.g-sync-jobs__row {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--g-border);
  font-size: 12.5px;
}
.g-sync-jobs__row:last-child { border-bottom: 0; }
.g-sync-jobs__icon i {
  font-size: 16px; color: var(--color-text-muted);
}
.g-sync-jobs__name { font-weight: 600; text-transform: capitalize; }
.g-sync-jobs__rows { color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.g-sync-jobs__status {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.g-sync-jobs__status--ok      { background: rgba(16,185,129,0.15); color: #10b981; }
.g-sync-jobs__status--error   { background: rgba(239,68,68,0.15);  color: #ef4444; }
.g-sync-jobs__status--skipped { background: rgba(156,163,175,0.15); color: #9ca3af; }
.g-sync-jobs__status--partial { background: rgba(245,158,11,0.15); color: #f59e0b; }
.g-sync-jobs__err { color: #f59e0b; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Setup guide modal */
.g-guide {
  font-size: 13.5px; line-height: 1.7;
  padding-left: 22px;
}
.g-guide li { margin-bottom: 14px; }
.g-guide ul {
  margin: 6px 0 6px 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--color-text-muted);
}
.g-guide code {
  background: rgba(0,0,0,0.3);
  padding: 2px 6px; border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.g-guide a { color: var(--color-primary); }

/* ─── Site Traffic — Google paneller ─────────────────────────────────── */

.st-google-section { margin-top: 22px; }
.st-google-section__head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.st-google-section__head h2 {
  margin: 0;
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.st-google-section__head h2 i {
  background: linear-gradient(135deg, #4285F4, #34A853, #FBBC05, #EA4335);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 22px;
}

.st-google-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(66,133,244,0.08), rgba(234,67,53,0.04));
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 12px;
  margin-bottom: 12px;
}
.st-google-banner strong { font-size: 13.5px; }
.st-google-banner p { margin: 4px 0 0 0; font-size: 12px; }

.st-google-card { position: relative; }
.st-ga4-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.st-mini-kpi {
  display: flex; flex-direction: column;
  padding: 10px 12px;
  background: var(--st-surface-2, rgba(255,255,255,0.02));
  border: 1px solid var(--g-border);
  border-radius: 8px;
}
.st-mini-kpi span {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.st-mini-kpi b {
  font-size: 18px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  letter-spacing: -0.3px;
}
.st-ga4-canvas-wrap {
  position: relative;
  margin-top: 6px;
}
.st-ga4-canvas-wrap canvas {
  display: block;
  width: 100%;
}

.st-gsc-queries-wrap { margin-top: 4px; }
.st-gsc-queries-head {
  font-size: 11.5px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 700;
  margin-bottom: 8px;
}
.st-gsc-queries {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.st-gsc-q {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: var(--st-surface-2);
  border-radius: 6px;
  font-size: 12px;
  transition: background 0.15s;
}
.st-gsc-q:hover { background: var(--st-surface, rgba(255,255,255,0.05)); }
.st-gsc-q__text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 500;
}
.st-gsc-q__metrics {
  display: flex; align-items: center; gap: 4px;
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
}
.st-gsc-q__metrics b { font-weight: 700; min-width: 22px; text-align: right; }
.st-gsc-q__metrics small {
  color: var(--color-text-muted); font-size: 9.5px;
  text-transform: uppercase; letter-spacing: 0.4px;
  margin-right: 4px;
}
.st-gsc-q__metrics i {
  font-style: normal;
  min-width: 22px; text-align: right;
}

.st-google-empty {
  text-align: center;
  padding: 30px 16px;
  color: var(--color-text-muted);
}
.st-google-empty i {
  font-size: 32px;
  opacity: 0.35;
  display: block;
  margin-bottom: 8px;
}
.st-google-empty p { margin: 0; font-size: 12.5px; }

/* Merchant summary pills */
.st-merchant-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
@media (max-width: 720px) {
  .st-merchant-summary { grid-template-columns: repeat(2, 1fr); }
  .st-ga4-kpis { grid-template-columns: repeat(2, 1fr); }
}
.st-merchant-pill {
  display: flex; flex-direction: column;
  padding: 10px 12px;
  background: var(--st-surface-2);
  border: 1px solid var(--g-border);
  border-radius: 8px;
}
.st-merchant-pill span {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.st-merchant-pill b {
  font-size: 20px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.st-merchant-pill--approved    { border-color: rgba(16,185,129,0.3); }
.st-merchant-pill--approved b  { color: #10b981; }
.st-merchant-pill--pending     { border-color: rgba(245,158,11,0.3); }
.st-merchant-pill--pending b   { color: #f59e0b; }
.st-merchant-pill--disapproved { border-color: rgba(239,68,68,0.3); }
.st-merchant-pill--disapproved b { color: #ef4444; }

.st-merch-issues__head {
  font-size: 11.5px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 700;
  margin-bottom: 8px;
}
.st-merch-issues {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.st-merch-issue {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--st-surface-2);
  border-radius: 6px;
  font-size: 12.5px;
}
.st-merch-issue__status {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.st-merch-issue__status--approved    { background: rgba(16,185,129,0.15); color: #10b981; }
.st-merch-issue__status--pending     { background: rgba(245,158,11,0.15); color: #f59e0b; }
.st-merch-issue__status--disapproved { background: rgba(239,68,68,0.15);  color: #ef4444; }
.st-merch-issue__status--expiring    { background: rgba(156,163,175,0.15); color: #9ca3af; }
.st-merch-issue__img {
  width: 36px; height: 36px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--st-surface);
}
.st-merch-issue__body { min-width: 0; }
.st-merch-issue__title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Integrasyon tab UI uyumu (mevcut .integ-tab-btn yapısı) ─────────── */
/* Google tab da diğerleri gibi davransın — özel tweak gerekmez, ama
   active state'inde Google brand renkleri kullansak hoş olur. */
