:root {
  --bg: #0a0e16;
  --bg-elev: #121826;
  --bg-elev-2: #182030;
  --bg-input: #0e1420;
  --border: #232d40;
  --border-soft: #1b2436;
  --text: #e9eef6;
  --text-dim: #93a1b5;
  --text-faint: #5f6e85;
  --primary: #5b8cff;
  --primary-2: #6d6cff;
  --primary-grad: linear-gradient(135deg, #6d6cff, #5b8cff);
  --green: #34d399;
  --green-bg: rgba(52, 211, 153, 0.12);
  --blue: #60a5fa;
  --blue-bg: rgba(96, 165, 250, 0.12);
  --amber: #fbbf24;
  --amber-bg: rgba(251, 191, 36, 0.12);
  --gold: #facc15;
  --gold-bg: rgba(250, 204, 21, 0.14);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
  --header-bg: rgba(12, 16, 26, 0.72);
  --body-grad-1: rgba(91, 140, 255, 0.12);
  --body-grad-2: rgba(109, 108, 255, 0.1);
}

/* ---------- Aydınlık tema (Zoromi) ---------- */
html[data-theme="light"] {
  --bg: #f4f4f6;
  --bg-elev: #ffffff;
  --bg-elev-2: #f5f5f8;
  --bg-input: #ffffff;
  --border: #e7e8ee;
  --border-soft: #eef0f4;
  --text: #17171c;
  --text-dim: #4b4d57;
  --text-faint: #969aa6;
  --primary: #7c6cf5;
  --primary-2: #8b7bf7;
  --primary-grad: linear-gradient(135deg, #8b7bf7, #7c6cf5);
  --green: #16a34a;
  --green-bg: rgba(22, 163, 74, 0.11);
  --blue: #2563eb;
  --blue-bg: rgba(37, 99, 235, 0.1);
  --amber: #d9820b;
  --amber-bg: rgba(217, 130, 11, 0.14);
  --gold: #b8860b;
  --gold-bg: rgba(184, 134, 11, 0.15);
  --red: #dc2626;
  --red-bg: rgba(220, 38, 38, 0.1);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 4px 18px rgba(30, 30, 50, 0.06);
  --shadow-lg: 0 16px 44px rgba(30, 30, 50, 0.12);
  --header-bg: #ffffff;
  --body-grad-1: transparent;
  --body-grad-2: transparent;
}
/* Aydınlık temada düşük kontrastı önle */
html[data-theme="light"] .chip-btn.active {
  color: #fff;
  background: var(--primary);
}
html[data-theme="light"] .nav-item:hover {
  background: rgba(20, 30, 60, 0.06);
}
html[data-theme="light"] .nav-item.active:hover {
  background: var(--primary-grad);
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-color: var(--border) transparent;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 85% -8%, var(--body-grad-1), transparent 60%),
    radial-gradient(720px 520px at 0% -5%, var(--body-grad-2), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- Header ---------- */
header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 18px rgba(91, 140, 255, 0.28);
}

.brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.brand-fallback {
  display: none;
  font-size: 19px;
  font-weight: 800;
  color: #fff;
}

.brand-mark.no-logo {
  background: var(--primary-grad);
}
.brand-mark.no-logo .brand-fallback {
  display: block;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

a.brand-sub {
  text-decoration: none;
  transition: color 0.15s;
}
a.brand-sub:hover {
  color: var(--primary);
  text-decoration: underline;
}

header .btn-ghost {
  margin-left: auto;
}

/* ---------- Layout ---------- */
main {
  max-width: 1020px;
  margin: 0 auto;
  padding: 26px 24px 60px;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hint {
  color: var(--text-dim);
  font-size: 13px;
  margin: -8px 0 18px;
}

.hint code {
  background: var(--bg-elev-2);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
}

/* ---------- KPI stat cards ---------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.stat {
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, border-color 0.15s;
}

.stat:hover {
  transform: translateY(-2px);
  border-color: var(--border);
}

.stat-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 18px;
  border-radius: 11px;
  background: var(--bg-elev-2);
}

.stat-green .stat-icon {
  background: var(--green-bg);
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-value.warn {
  color: var(--amber);
}
.stat-value.over {
  color: var(--red);
}

.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ---------- Forms ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 18px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
}

input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder {
  color: var(--text-faint);
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.18);
}

.grid select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.grid select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.18);
}
.grid select option {
  background: var(--bg-elev-2);
  color: var(--text);
}

textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 56px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.18);
}

/* Çoklu API anahtarı — 3 ayrı kutu */
.api-keys-3 {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.api-keys-3 input {
  width: 100%;
  box-sizing: border-box;
}

.settings-sub {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 6px 0 6px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}

.grid label.full {
  grid-column: 1 / -1;
}

.check-row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 2px 0 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.check-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.settings-actions .save-msg {
  margin-left: 0;
}

.settings-save-bar {
  position: sticky;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 18px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
}
.settings-save-bar #saveSettings {
  font-size: 14px;
  padding: 11px 22px;
}
.settings-save-bar .save-msg {
  margin-left: 0;
}

.inline-form {
  display: flex;
  gap: 11px;
  flex-wrap: wrap;
}

.inline-form input {
  flex: 1;
  min-width: 170px;
}

/* ---------- Buttons ---------- */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 17px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s, background 0.15s, opacity 0.15s, border-color 0.15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary-grad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(91, 140, 255, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.07);
}

.btn-ghost {
  background: var(--bg-elev-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-faint);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.save-msg {
  margin-left: 12px;
  font-size: 13px;
  color: var(--green);
  font-weight: 500;
}

/* ---------- Site card ---------- */
.site-card {
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.site-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent);
}

.site-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.site-row1 {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-fav {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  margin-top: 1px;
  border-radius: 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-dim);
}

.site-fav img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.site-fav-empty {
  background: var(--primary-grad);
  color: #fff;
  border-color: transparent;
}

.site-fav-empty img {
  display: none;
}

.site-head .site-title {
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.01em;
}

.site-head .site-domain {
  color: var(--text-faint);
  font-size: 13px;
}

.site-head .actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* ---------- Table ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 13px 22px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  font-weight: 600;
}

tbody tr {
  transition: background 0.12s;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.018);
}

tbody tr:last-child td {
  border-bottom: none;
}

.kw-name {
  font-weight: 500;
}

.kw-meta {
  color: var(--text-faint);
  font-size: 11.5px;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.checked-at {
  color: var(--text-dim);
  font-size: 12.5px;
}

.checked-at a {
  color: var(--primary);
  text-decoration: none;
}
.checked-at a:hover {
  text-decoration: underline;
}

/* ---------- Badges (sıra) ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 11px;
  border-radius: 999px;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
}

.badge-gold {
  color: var(--gold);
  background: var(--gold-bg);
  border-color: rgba(250, 204, 21, 0.25);
}
.badge-green {
  color: var(--green);
  background: var(--green-bg);
  border-color: rgba(52, 211, 153, 0.22);
}
.badge-blue {
  color: var(--blue);
  background: var(--blue-bg);
  border-color: rgba(96, 165, 250, 0.22);
}
.badge-amber {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: rgba(251, 191, 36, 0.22);
}
.badge-muted {
  color: var(--text-faint);
  background: var(--bg-elev-2);
  font-weight: 500;
  font-size: 12px;
}
.badge-error {
  color: var(--red);
  background: var(--red-bg);
  font-weight: 500;
  font-size: 12px;
}

/* ---------- Trend chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 12.5px;
  padding: 3px 9px;
  border-radius: 8px;
}
.chip-up {
  color: var(--green);
  background: var(--green-bg);
}
.chip-down {
  color: var(--red);
  background: var(--red-bg);
}
.chip-flat {
  color: var(--text-faint);
}

/* ---------- Add keyword row ---------- */
.add-kw-row td {
  background: rgba(255, 255, 255, 0.015);
  padding: 14px 22px;
}

.add-kw-form {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
  max-width: 760px;
}

.add-kw-form input[type="text"] {
  flex: 1 1 220px;
  min-width: 180px;
}

.add-kw-form input.small {
  width: 60px;
  flex: 0 0 auto;
  min-width: 0;
  text-align: center;
}

/* Kelime tablosu: 4 işlem butonu + kolonlar karta sığsın (taşma/kırpılma olmasın) */
.site-body th,
.site-body td {
  padding: 12px 13px;
}

.op-cell {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
}

.icon-btn {
  width: 32px;
  padding: 6px 0;
  text-align: center;
}

.check-btn {
  padding: 7px 13px;
  flex: 0 0 auto;
}

/* Satır eylem butonları (yuvarlak, tonlu hover) */
.act-btn {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-faint);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.act-btn:hover {
  transform: translateY(-1px);
}
.act-hist:hover {
  background: var(--blue-bg);
  color: var(--blue);
}
.act-del:hover {
  background: var(--red-bg);
  color: var(--red);
}

/* Birleşik ülke/dil kontrolü */
.locale-mini {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 9px;
  flex: 0 0 auto;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.locale-mini:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.18);
}
.locale-ico {
  font-size: 12px;
  opacity: 0.6;
}
.locale-sep {
  color: var(--text-faint);
}
.add-kw-form .locale-mini input.small {
  width: 26px;
  border: none;
  background: transparent;
  padding: 9px 0;
  text-align: center;
}
.add-kw-form .locale-mini input.small:focus {
  box-shadow: none;
}
/* Ülke ön ayar seçici (gl+hl+location'ı birlikte ayarlar) */
.locale-mini .country-sel {
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 2px;
  cursor: pointer;
}
.locale-mini .country-sel:focus {
  outline: none;
}
.locale-mini .country-sel option {
  background: var(--bg-elev-2);
  color: var(--text);
}
/* Kelime adının yanındaki ülke bayrağı (TR dışı) */
.kw-flag {
  margin-right: 5px;
  font-size: 13px;
  cursor: default;
}

/* Toplu kelime ekleme paneli */
.bulk-add {
  padding: 6px 2px 2px;
}
.bulk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
}
.bulk-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
}
.bulk-ta {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  resize: vertical;
  min-height: 92px;
}
.bulk-ta:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.18);
}
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 9px;
}
.bulk-target {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
}
.bulk-lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}
.bulk-sel {
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 2px;
  cursor: pointer;
}
.bulk-sel:focus {
  outline: none;
}
.bulk-sel option {
  background: var(--bg-elev-2);
  color: var(--text);
}

/* Hedef sıra: durum noktalı pill + özel açılır menü */
.target-cell {
  white-space: nowrap;
}
.target-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.target-btn:hover {
  border-color: var(--text-faint);
  color: var(--text);
}
.target-btn.open {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.18);
}
.tgt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  flex: 0 0 auto;
}
.target-btn.tgt-in {
  color: var(--green);
  border-color: rgba(52, 211, 153, 0.35);
}
.target-btn.tgt-in .tgt-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-bg);
}
.target-btn.tgt-out .tgt-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-bg);
}
.tgt-caret {
  font-size: 9px;
  opacity: 0.55;
}

.target-menu {
  position: fixed;
  z-index: 100;
  min-width: 152px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: tgt-pop 0.12s ease-out;
}
@keyframes tgt-pop {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.target-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 8px 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s;
}
.target-opt:hover {
  background: var(--bg-elev-2);
}
.target-opt.sel {
  color: var(--primary);
  font-weight: 700;
}
.opt-check {
  width: 12px;
  font-size: 12px;
  color: var(--primary);
}

/* Son Yapılanlar (aktivite) */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.act-icon {
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
}
.act-body {
  flex: 1;
  min-width: 0;
}
.act-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.act-scope {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.act-checked {
  font-size: 12px;
  color: var(--text-dim);
}
.act-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
}
.act-up {
  color: var(--green);
}
.act-down {
  color: var(--red);
}
.act-same {
  color: var(--text-faint);
}
.act-when {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
}

/* Tablo başlığı ince ayırıcı */
.site-body thead th {
  background: rgba(255, 255, 255, 0.012);
}

.empty {
  text-align: center;
  color: var(--text-dim);
  padding: 40px 20px;
  background: var(--bg-elev);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.hidden {
  display: none !important;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 12, 0.66);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: min(620px, 100%);
  max-height: 82vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  background: var(--bg-elev);
  z-index: 1;
}

.modal-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

/* Site düzenleme modalı */
.modal-sm {
  width: min(440px, 100%);
}
.site-edit-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.site-edit-body label {
  font-size: 13px;
}
.site-edit-body input {
  width: 100%;
  box-sizing: border-box;
}
.site-edit-body .hint {
  margin: 0;
}
.site-edit-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}
/* Düzenleme modalındaki seçiciler (kelime hedefi) */
.site-edit-body select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.site-edit-body select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.18);
}
.site-edit-body select option {
  background: var(--bg-elev-2);
  color: var(--text);
}
.site-edit-body .locale-mini {
  align-self: flex-start;
}

/* Rapor kartı butonları */
.report-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.report-btns .report-dl {
  flex: 1;
  white-space: nowrap;
}

/* Rapora kelime seçme modalı */
.report-select-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rsel-search {
  width: 100%;
  box-sizing: border-box;
}
.rsel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rsel-all {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
}
.rsel-all input[type='checkbox'] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}
.rsel-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
}
.rsel-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 44vh;
  overflow-y: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 6px;
}
.rsel-item {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.rsel-item:hover {
  background: var(--bg-elev-2);
}
.rsel-item input[type='checkbox'] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
  flex: 0 0 auto;
}
.rsel-kw {
  flex: 1;
  min-width: 0;
  color: var(--text);
}
.rsel-kw .kw-flag {
  margin-right: 4px;
}
.rsel-rank {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
}
.rsel-actions .btn {
  width: 100%;
}

#historyBody {
  padding: 6px 0;
}

/* ---------- History summary + sparkline ---------- */
.hist-summary {
  padding: 18px 22px 6px;
}

.hist-kpis {
  display: flex;
  gap: 26px;
  margin-bottom: 8px;
}

.hist-kpis > div {
  display: flex;
  flex-direction: column;
}

.hist-k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.hist-v {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Sıra trendi — odaklı başlık */
.trend-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.trend-now {
  display: flex;
  flex-direction: column;
}
.trend-now-v {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.trend-now-k {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 5px;
}
.trend-meta {
  display: flex;
  gap: 24px;
}
.trend-meta > div {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.trend-up {
  color: var(--green);
}
.trend-down {
  color: var(--red);
}
.trend-note {
  margin: 4px 0 2px;
  font-size: 12.5px;
  color: var(--text-dim);
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}

.spark {
  width: 100%;
  height: 96px;
  display: block;
  margin-top: 4px;
}

.spark circle {
  fill: var(--primary);
}

/* ---------- Çizgi grafik ---------- */
.chart {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 6px;
}
.ch-grid {
  stroke: var(--border-soft);
  stroke-width: 1;
}
.ch-ylabel,
.ch-xlabel {
  fill: var(--text-faint);
  font-size: 10px;
  font-family: inherit;
}
.ch-area {
  fill: rgba(91, 140, 255, 0.14);
}
.ch-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.ch-dot {
  fill: var(--primary);
  stroke: var(--bg-elev);
  stroke-width: 1.5;
  cursor: pointer;
}
.ch-dot:hover {
  r: 5;
}

/* ---- Görünürlük Paneli ---- */
.vispanel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.vispanel-head h2 {
  margin: 0;
}
.vis-badge {
  font-size: 13px;
  color: var(--text-faint);
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  padding: 5px 13px;
  border-radius: 999px;
  white-space: nowrap;
}
.vis-badge b {
  color: var(--primary);
  font-size: 15px;
}
.vis-badge small {
  font-weight: 500;
}
.dist {
  margin: 0 0 18px;
}
.dist-bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
}
.dist-bar > div {
  height: 100%;
}
.dist-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 9px;
  font-size: 12px;
  color: var(--text-faint);
}
.dist-legend .leg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dist-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.dist-legend b {
  color: var(--text-strong, currentColor);
  font-weight: 700;
}
.vis-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
  margin: 4px 0 2px;
}
.vis-trend {
  min-height: 60px;
}
/* Görünürlük özet kutucukları (temiz, sabit sayılar) */
.vis-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.vis-tile {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 15px 16px;
}
.vt-num {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.vt-lbl {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* Otomatik tarama aç/kapa anahtarı (Ayarlar) */
.sched-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.sched-toggle input {
  margin-top: 2px;
  flex: 0 0 auto;
}
.sched-toggle span {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.45;
}
.sched-toggle b {
  color: var(--text);
  font-weight: 600;
}
@media (max-width: 560px) {
  .vis-tiles { grid-template-columns: repeat(2, 1fr); }
}
.stat-gold .stat-icon {
  background: var(--gold-bg, rgba(217, 158, 0, 0.16));
}

/* ---- SERP özellik çipleri + kanibalizasyon ---- */
.kw-feats {
  display: inline-flex;
  gap: 3px;
  margin-left: 8px;
  vertical-align: middle;
}
.feat-chip {
  font-size: 12px;
  line-height: 18px;
  height: 18px;
  min-width: 18px;
  text-align: center;
  cursor: help;
  opacity: 0.75;
}
.feat-chip.feat-own {
  opacity: 1;
  border-radius: 5px;
  padding: 0 3px;
  background: var(--green-bg, rgba(22, 163, 74, 0.16));
}
.kw-url-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.kw-cannib {
  color: var(--amber, #e0a800);
  cursor: help;
  font-size: 12px;
  white-space: pre-line;
}

/* ---- Kelime etiketleri (gruplama) ---- */
.kw-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.kw-tag {
  font-size: 10.5px;
  line-height: 1.6;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  color: var(--text-faint);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  white-space: nowrap;
}
.kw-tag:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* ---- Google'da kişiselleştirmesiz kontrol linki (pws=0) ---- */
.kw-serp-link {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 5px;
  font-size: 11.5px;
  line-height: 1;
  vertical-align: middle;
  text-decoration: none;
  /* --text-faint + opacity açık temada ~1.9:1 kontrast veriyordu (görünmezdi);
     --text-dim her iki temada da 3:1 üzerinde. */
  color: var(--text-dim);
  cursor: pointer;
  user-select: none; /* kelimeyi kopyalarken '↗' panoya gitmesin */
  transition: color 0.15s;
}
.kw-serp-link:hover {
  color: var(--primary);
  text-decoration: none;
}
.kw-serp-link:focus-visible {
  color: var(--primary);
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Grafik olay/not işaretleyicileri */
.ch-anno {
  stroke: var(--amber);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  opacity: 0.7;
}
.ch-anno-dot {
  fill: var(--amber);
  cursor: pointer;
}
.ch-anno-num {
  fill: #1a1205;
  font-size: 10px;
  font-weight: 800;
  pointer-events: none;
}

/* Notlar bölümü (trend modalı) */
.notes-section {
  padding: 8px 22px 20px;
  border-top: 1px solid var(--border-soft);
  margin-top: 12px;
}
.notes-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  margin: 10px 0 12px;
}
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.note-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.note-num {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--amber);
  color: #1a1205;
  font-size: 11px;
  font-weight: 800;
}
.note-date {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--text-dim);
  font-size: 12px;
  min-width: 56px;
}
.note-text {
  flex: 1;
  min-width: 0;
  color: var(--text);
}
.note-row .act-del {
  flex: 0 0 auto;
}
.notes-empty {
  font-size: 12.5px;
  color: var(--text-faint);
  margin: 0 0 14px;
}
.note-add-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.note-add-form input[type='date'] {
  flex: 0 0 auto;
  width: auto;
}
.note-add-form input[type='text'] {
  flex: 1 1 220px;
  min-width: 160px;
}

/* ---------- Spinner ---------- */
.spin {
  display: inline-block;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Top nav ---------- */
.nav {
  display: flex;
  gap: 3px;
  margin-left: 18px;
  padding: 5px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.nav::-webkit-scrollbar {
  display: none;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: #fff;
  background: var(--primary-grad);
  box-shadow: 0 4px 12px rgba(91, 140, 255, 0.32);
}

.nav-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.usage-badge {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  padding: 8px 13px;
  border-radius: 999px;
  white-space: nowrap;
}
.usage-badge.warn {
  color: var(--amber);
  border-color: rgba(251, 191, 36, 0.3);
}
.usage-badge.over {
  color: var(--red);
  border-color: rgba(248, 113, 113, 0.3);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  font-size: 17px;
  line-height: 1;
  color: var(--text-dim);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
}
.theme-toggle:hover {
  border-color: var(--text-faint);
  transform: translateY(-1px);
}
.theme-toggle:active {
  transform: translateY(0);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}
.header-username::before {
  content: '👤 ';
}

/* ---------- Giriş sayfası ---------- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
/* Split: solda görsel, sağda form */
.login-split {
  width: 100%;
  max-width: 940px;
  min-height: 560px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* ----- SOL görsel panel ----- */
.login-visual {
  position: relative;
  padding: 40px 38px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  color: #fff;
  background: linear-gradient(150deg, #6d6cff 0%, #5b8cff 52%, #22d3ee 135%);
  overflow: hidden;
}
.login-visual::before {
  content: '';
  position: absolute;
  top: -90px;
  right: -70px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
}
.login-visual::after {
  content: '';
  position: absolute;
  bottom: -120px;
  left: -90px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%);
}
.lv-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 11px;
}
.lv-logo {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 19px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.lv-brand {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.lv-mid {
  position: relative;
  z-index: 2;
}
.lv-title {
  font-size: 29px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  max-width: 340px;
}
.lv-text {
  font-size: 13.5px;
  line-height: 1.65;
  opacity: 0.92;
  max-width: 330px;
  margin: 0 0 22px;
}
.lv-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.lv-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0.96;
}
.lv-features li span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 13px;
  flex: 0 0 auto;
}
.lv-foot {
  position: relative;
  z-index: 2;
  font-size: 12px;
  opacity: 0.82;
  font-weight: 500;
}
.lv-deco {
  position: absolute;
  right: -26px;
  bottom: -22px;
  width: 260px;
  opacity: 0.18;
  z-index: 1;
  pointer-events: none;
}

/* ----- SAĞ form paneli ----- */
.login-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 46px;
}
.login-box {
  width: 100%;
  max-width: 340px;
}
.login-brand-sm {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.login-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 20px;
  border-radius: 12px;
  background: var(--primary-grad);
  box-shadow: 0 6px 18px rgba(91, 140, 255, 0.35);
}
.login-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.login-sub {
  font-size: 12px;
  color: var(--text-faint);
}
.login-h {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 5px;
}
.login-h-sub {
  font-size: 13.5px;
  color: var(--text-dim);
  margin: 0 0 26px;
}
.login-box form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.login-box label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
}
.login-btn {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  font-size: 14.5px;
}
.login-err {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
  text-align: center;
}

/* Dar ekran: sol görseli gizle, sadece formu göster (mobil marka görünür) */
@media (max-width: 760px) {
  .login-split {
    grid-template-columns: 1fr;
    max-width: 410px;
    min-height: auto;
  }
  .login-visual {
    display: none;
  }
  .login-form-side {
    padding: 34px 28px;
  }
  .login-brand-sm {
    display: flex;
  }
}

.back-btn {
  margin-bottom: 16px;
}

/* ---------- Açılır/kapanır site ---------- */
.site-head {
  cursor: pointer;
  user-select: none;
}

.chevron {
  flex: 0 0 auto;
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 12px;
  transition: transform 0.2s ease;
}

.site-card:not(.collapsed) .chevron {
  transform: rotate(90deg);
}

.site-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.site-mini {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.mini-ico {
  font-size: 12.5px;
  line-height: 1;
}

.mini-lbl {
  color: var(--text-faint);
  letter-spacing: 0.01em;
}

.mini-val {
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.mini-pill.mini-green {
  background: var(--green-bg);
  border-color: rgba(52, 211, 153, 0.24);
}
.mini-pill.mini-green .mini-lbl {
  color: rgba(52, 211, 153, 0.85);
}
.mini-pill.mini-green .mini-val {
  color: var(--green);
}

.mini-pill.mini-gold {
  background: var(--gold-bg);
  border-color: rgba(250, 204, 21, 0.28);
}
.mini-pill.mini-gold .mini-lbl {
  color: rgba(250, 204, 21, 0.85);
}
.mini-pill.mini-gold .mini-val {
  color: var(--gold);
}

/* Aydınlık modda pill'lerin kontrastını artır (beyaz kartta net görünsün) */
html[data-theme="light"] .mini-pill {
  background: #eef2f9;
  border-color: var(--border);
}
html[data-theme="light"] .mini-lbl {
  color: var(--text-dim);
}
html[data-theme="light"] .mini-pill.mini-green {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.35);
}
html[data-theme="light"] .mini-pill.mini-green .mini-lbl {
  color: #047857;
}
html[data-theme="light"] .mini-pill.mini-gold {
  background: rgba(180, 83, 9, 0.1);
  border-color: rgba(180, 83, 9, 0.32);
}
html[data-theme="light"] .mini-pill.mini-gold .mini-lbl,
html[data-theme="light"] .mini-pill.mini-gold .mini-val {
  color: #b45309;
}

.site-card.collapsed .site-body {
  display: none;
}

/* Kelime tablosu dar alanda taşarsa yatay kaydırılabilsin — son sütun (Kontrol/✏️/✕
   silme butonu) kartın sağ kenarında kırpılıp erişilemez kalmasın diye. */
.site-body {
  overflow-x: auto;
}

/* ---------- Sıralanan sayfa URL'i ---------- */
.kw-url-cell {
  max-width: 160px;
}
.kw-url {
  color: var(--blue);
  text-decoration: none;
  font-size: 12.5px;
  display: inline-block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.kw-url:hover {
  text-decoration: underline;
}
.kw-url-empty {
  color: var(--text-faint);
}

/* ---------- MAP Analiz ---------- */
.map-card {
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.map-head {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.map-head .site-fav {
  width: 40px;
  height: 40px;
}
.map-head .site-fav img {
  width: 24px;
  height: 24px;
}
.map-head .chevron {
  flex: 0 0 auto;
  color: var(--text-faint);
  font-size: 12px;
  transition: transform 0.2s ease;
}
.map-card:not(.collapsed) .chevron {
  transform: rotate(90deg);
}
.map-card.collapsed .map-body {
  display: none;
}
.map-head-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.map-hsum {
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: nowrap;
}
.map-body {
  margin-top: 6px;
}
.map-id {
  min-width: 0;
  flex: 1;
}
.map-name {
  font-weight: 700;
  font-size: 15px;
}
.map-domain {
  font-size: 12.5px;
  color: var(--text-faint);
}
.map-status {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.map-status.on {
  color: #e879f9;
  background: rgba(217, 70, 239, 0.13);
  border: 1px solid rgba(217, 70, 239, 0.3);
}
.map-status.off {
  color: var(--text-faint);
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
}
.map-config {
  margin: 0 0 6px;
}
.map-config .grid {
  margin-bottom: 12px;
}
.map-config-btns {
  display: flex;
  gap: 10px;
}

/* =====================================================================
   ZOROMI YENİDEN TASARIM — sidebar kabuk + ferah içerik + pastel kartlar
   (bu blok sonda; önceki kuralları override eder)
   ===================================================================== */

/* --- Kabuk: sol sidebar + sağ içerik --- */
.shell {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  align-items: start;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 13px;
  background: var(--bg-elev);
  border-right: 1px solid var(--border-soft);
  scrollbar-width: thin;
}

/* Marka (sidebar başı) */
.sidebar .brand { gap: 10px; padding: 4px 6px 2px; }
.sidebar .brand-mark { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 4px 12px rgba(124,108,245,.28); }
.sidebar .brand-logo { width: 20px; height: 20px; }
.sidebar .brand-title { font-size: 15px; }
.sidebar .brand-sub { font-size: 11px; }

/* Yeni Site + Ara */
.side-new {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; border: 1px solid var(--border); border-radius: 12px;
  font-size: 13.5px; font-weight: 600; color: var(--text-dim); background: var(--bg-elev);
  cursor: pointer; transition: .15s;
}
.side-new:hover { background: var(--bg-elev-2); color: var(--text); }
.side-search {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 11px; border: 1px solid var(--border-soft); border-radius: 11px;
  color: var(--text-faint); font-size: 13px; background: var(--bg-elev-2); cursor: text;
}
.side-search-txt { flex: 1; }
.side-kbd { font-size: 10.5px; border: 1px solid var(--border-soft); border-radius: 6px; padding: 1px 6px; background: var(--bg-elev); }

.side-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-faint); padding: 2px 8px; margin-top: 2px;
}

/* Dikey menü — modern: SVG ikonlar + mor aktif durum + sol aksan çubuğu */
.shell .sidebar .nav {
  display: flex; flex-direction: column; gap: 3px; align-items: stretch;
  background: transparent; border: none; padding: 0;
}
.shell .sidebar .nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; position: relative;
  padding: 10px 12px; border-radius: 11px; border: none; cursor: pointer;
  font-size: 13.5px; font-weight: 500; color: var(--text-dim);
  background: transparent; text-align: left;
  transition: background .14s, color .14s;
}
.nav-ic {
  width: 20px; height: 20px; flex: 0 0 auto;
  display: grid; place-items: center; color: var(--text-faint);
  transition: color .14s, transform .14s;
}
.nav-ic svg { width: 18px; height: 18px; display: block; }
.shell .sidebar .nav-item:hover { background: var(--bg-elev-2); color: var(--text); }
.shell .sidebar .nav-item:hover .nav-ic { color: var(--text-dim); transform: translateX(1px); }
html[data-theme="light"] .shell .sidebar .nav-item.active,
.shell .sidebar .nav-item.active {
  background: rgba(124, 108, 245, 0.1); color: var(--primary); font-weight: 600; box-shadow: none;
}
.shell .sidebar .nav-item.active .nav-ic { color: var(--primary); }
html[data-theme="light"] .shell .sidebar .nav-item.active:hover {
  background: rgba(124, 108, 245, 0.15);
}
.shell .sidebar .nav-item.active::before {
  content: ""; position: absolute; left: 3px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 17px; border-radius: 3px; background: var(--primary);
}

/* Sidebar altı: kullanım + tema/çıkış */
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 8px; border-top: 1px solid var(--border-soft); }
.side-foot .usage-badge { align-self: flex-start; }
.side-foot-row { display: flex; align-items: center; gap: 8px; }
.side-foot-row .header-username { font-size: 12.5px; color: var(--text-dim); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- İçerik alanı --- */
.shell main {
  max-width: none; margin: 0; padding: 26px 34px 54px;
}

/* Kartlar biraz daha yumuşak/ferah */
.card { box-shadow: var(--shadow); border-radius: var(--radius); }

/* --- KPI kartları: pastel gradient, büyük rakam --- */
.stats-row { grid-template-columns: repeat(3, 1fr); gap: 15px; }
.stat {
  flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px;
  padding: 20px 20px 18px; min-height: 116px; position: relative; overflow: hidden;
  border-radius: 20px; box-shadow: none; border: 1px solid var(--border-soft);
}
.stat-body { display: flex; flex-direction: column; gap: 2px; }
.stat-value { font-size: 33px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12.5px; color: var(--text-dim); font-weight: 500; }
.stat-icon {
  position: absolute; top: 16px; right: 16px; width: 30px; height: 30px;
  font-size: 14px; border-radius: 9px; background: rgba(255,255,255,.72);
}
.stats-row .stat:nth-child(1) { background: linear-gradient(150deg, #efe9ff, #f8f2ff 62%, #fff); }
.stats-row .stat:nth-child(2) { background: linear-gradient(150deg, #fde9f1, #fdf1f6 62%, #fff); }
.stats-row .stat:nth-child(3) { background: linear-gradient(150deg, #e4f4ee, #eef8f3 62%, #fff); }
.stats-row .stat:nth-child(4) { background: linear-gradient(150deg, #e7eefc, #eef3fd 62%, #fff); }
.stats-row .stat:nth-child(5) { background: linear-gradient(150deg, #fdf0e4, #fef5ec 62%, #fff); }
.stats-row .stat:nth-child(6) { background: linear-gradient(150deg, #eae7fb, #f2f0fd 62%, #fff); }
.stat:hover { transform: translateY(-2px); }

/* Dar ekran: sidebar üstte/gizli, kartlar sarsın */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar .side-label, .side-new, .side-search, .side-foot { display: none; }
  .shell .sidebar .nav { flex-direction: row; flex-wrap: wrap; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .shell main { padding: 20px; }
}

/* Aç/kapa anahtarı */
.map-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  margin: 14px 0;
}
.map-toggle-label {
  font-weight: 600;
  font-size: 14px;
}
.map-toggle-sub {
  font-size: 12px;
  color: var(--text-faint);
  margin-left: 8px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: 0.2s;
}
.slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: var(--text-faint);
  border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .slider {
  background: var(--primary-grad);
  border-color: transparent;
}
.switch input:checked + .slider::before {
  transform: translateX(20px);
  background: #fff;
}
.map-off-hint {
  color: var(--text-faint);
  font-size: 12.5px;
  margin: 8px 0 0;
}
.map-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0 12px;
}
.map-summary {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.map-table-wrap {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.map-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.map-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.012);
}
.map-table td {
  padding: 11px 14px;
  border-top: 1px solid var(--border-soft);
}
.map-table td.num {
  color: var(--text-faint);
  width: 38px;
}
.map-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.018);
}
.map-badge {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 11px;
  border-radius: 999px;
  color: #e879f9;
  background: rgba(217, 70, 239, 0.13);
  border: 1px solid rgba(217, 70, 239, 0.28);
}
.map-badge.top {
  color: var(--gold);
  background: var(--gold-bg);
  border-color: rgba(250, 204, 21, 0.25);
}

/* İşletme bilgisi (Google Haritalar) */
.map-hrating {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--amber);
  white-space: nowrap;
}
.map-bizinfo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.biz-rating {
  font-size: 14px;
  font-weight: 800;
  color: var(--amber);
}
.biz-rating small {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-faint);
}
.biz-chip {
  font-size: 12.5px;
  color: var(--text-dim);
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 5px 11px;
}
.biz-chip.biz-addr {
  color: var(--text-faint);
}
.biz-chip.biz-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.biz-chip.biz-link:hover {
  border-color: var(--primary);
}

/* ---------- Raporlar ---------- */
.reports-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  background:
    radial-gradient(680px 220px at 100% 0%, rgba(91, 140, 255, 0.16), transparent 70%),
    var(--bg-elev);
}
.reports-hero .reports-hero-text {
  min-width: 0;
}
.reports-hero h2 {
  margin-bottom: 6px;
}
.reports-hero .hint {
  margin: 0;
  max-width: 560px;
}
.reports-hero #reportAll {
  flex: 0 0 auto;
  padding: 12px 20px;
  font-size: 14px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.report-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  animation: cardIn 0.32s ease backwards;
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.report-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--primary-grad);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.report-card:hover {
  transform: translateY(-4px);
  border-color: var(--border);
  box-shadow: var(--shadow-lg);
}
.report-card:hover::before {
  opacity: 1;
}

.report-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.report-card-head .site-fav {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  font-size: 17px;
}
.report-card-head .site-fav img {
  width: 25px;
  height: 25px;
}
.report-card-id {
  min-width: 0;
}
.report-name {
  font-weight: 700;
  font-size: 15px;
}
.report-domain {
  font-size: 12.5px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.report-status {
  font-size: 12.5px;
  color: var(--text-faint);
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 9px 12px;
}
.report-status.done {
  color: var(--text-dim);
}
.report-status b {
  color: var(--text);
  font-weight: 600;
}
.report-dl {
  margin-top: auto;
  width: 100%;
}

/* ---------- Kullanım kartı (Ayarlar) ---------- */
.usage-card h2 {
  margin-bottom: 18px;
}
.usage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.usage-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 9px;
}
.usage-k {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
}
.usage-v {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.usage-v small {
  font-size: 13px;
  color: var(--text-faint);
  font-weight: 600;
}
.usage-v.warn {
  color: var(--amber);
}
.usage-v.over {
  color: var(--red);
}
.bar {
  height: 9px;
  background: var(--bg-elev-2);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s ease;
}
.bar-fill.green {
  background: linear-gradient(90deg, #22c55e, #34d399);
}
.bar-fill.blue {
  background: linear-gradient(90deg, #3b82f6, #5b8cff);
}
.bar-fill.amber {
  background: var(--amber);
}
.bar-fill.red {
  background: var(--red);
}
.usage-sub {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-faint);
}
.usage-sub b {
  color: var(--text-dim);
}

@media (max-width: 620px) {
  .usage-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* ---------- Araç çubuğu (arama/filtre/sıralama) ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar-search {
  flex: 1;
  min-width: 200px;
}
.toolbar-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip-btn {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip-btn:hover {
  color: var(--text);
  border-color: var(--text-faint);
}
.chip-btn.active {
  background: rgba(91, 140, 255, 0.16);
  border-color: transparent;
  color: #fff;
}
.toolbar-sort {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 12px;
  cursor: pointer;
}
.toolbar-sort:focus {
  outline: none;
  border-color: var(--primary);
}

/* ---------- Anasayfa panosu: ayrı yükselen/düşen kartları ---------- */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}
.mover-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: none;
}
/* Pastel-gradient minimal (KPI kartlarıyla aynı dil) */
.mover-card.up {
  background: linear-gradient(150deg, #e4f4ee 0%, #eef8f3 60%, #ffffff 100%);
}
.mover-card.down {
  background: linear-gradient(150deg, #fde9ee 0%, #fdf1f4 60%, #ffffff 100%);
}
.mover-card::before { display: none; }
.mover-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
}
.mc-icon {
  font-size: 15px;
}
.mc-title {
  flex: 1;
  letter-spacing: -0.01em;
}
.mover-card.up .mc-title {
  color: var(--green);
}
.mover-card.down .mc-title {
  color: var(--red);
}
.mc-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--bg-elev-2);
  border-radius: 999px;
  padding: 2px 9px;
}
.mover-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mover-card li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--border-soft);
}
.mover-card li:first-child {
  border-top: none;
}
.mc-info {
  min-width: 0;
}
.mc-kw {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-site {
  display: block;
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 1px;
}
.mc-delta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: 0 0 auto;
}
.mc-badge {
  font-size: 13px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 8px;
}
.mc-badge.up {
  color: var(--green);
  background: var(--green-bg);
}
.mc-badge.down {
  color: var(--red);
  background: var(--red-bg);
}
.mc-trans {
  font-size: 11px;
  color: var(--text-faint);
}
.mc-empty {
  color: var(--text-faint);
  padding: 8px 0;
  font-size: 12.5px;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-mini {
    display: none;
  }
  /* dar ekranda: Sıralanan Sayfa, Trend ve Son Kontrol sütunlarını gizle */
  th:nth-child(2),
  td:nth-child(2),
  th:nth-child(4),
  td:nth-child(4),
  th:nth-child(5),
  td:nth-child(5) {
    display: none;
  }
}

@media (max-width: 620px) {
  main {
    padding: 18px 14px 40px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .stat-value {
    font-size: 20px;
  }
  .brand-sub {
    display: none;
  }
  .nav {
    margin-left: 10px;
  }
  .nav-item {
    padding: 8px 11px;
    font-size: 13px;
  }
}
