/* Yeniden kullanılabilir bileşenler: kart, buton, tablo, rozet, grid, modal. */

/* ---- Kart ---- */
.card {
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card__label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card__value {
  font-size: 26px;
  font-weight: 800;
  margin-top: 6px;
  font-family: var(--font-mono);
}

/* ---- İstatistik grid ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

/* ---- Buton ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, filter 0.15s, background 0.15s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 18px var(--accent-glow);
}
.btn--ghost { background: transparent; }
.btn--danger { background: rgba(255, 91, 110, 0.12); border-color: var(--danger); color: var(--danger); }
.btn--success { background: rgba(61, 220, 151, 0.12); border-color: var(--success); color: var(--success); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Rozet ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
}
.badge--success { background: rgba(61, 220, 151, 0.12); color: var(--success); border-color: transparent; }
.badge--warning { background: rgba(255, 181, 71, 0.12); color: var(--warning); border-color: transparent; }
.badge--danger { background: rgba(255, 91, 110, 0.12); color: var(--danger); border-color: transparent; }
.badge--muted { color: var(--text-muted); }

/* ---- Tablo ---- */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
}
.tbl td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--surface-2); }
.num { font-family: var(--font-mono); text-align: right; }
.pos { color: var(--success); }
.neg { color: var(--danger); }

/* ---- Form ---- */
.field { margin-bottom: 14px; }
.field__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { resize: vertical; min-height: 90px; }

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

/* ---- Yardımcılar ---- */
.row { display: flex; gap: 12px; align-items: center; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.mt-16 { margin-top: 16px; }
.muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); }

/* ---- Durum / boş / yükleniyor ---- */
.state {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}
.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-banner {
  background: rgba(255, 91, 110, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

/* ---- Kreatif önizleme ---- */
.creative-preview {
  white-space: pre-wrap;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  line-height: 1.6;
}
.creative-preview img {
  max-width: 100%;
  border-radius: var(--radius);
  margin-bottom: 14px;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 10, 0.66);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 16px;
  overflow-y: auto;
  z-index: 100;
}
.modal {
  width: 100%;
  max-width: 520px;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg, 0 24px 60px rgba(0, 0, 0, 0.5));
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal__title { font-size: 17px; font-weight: 700; }
.modal__close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.modal__close:hover { color: var(--text); }
.modal__body { padding: 20px; }

/* ---- Sayfa araç çubuğu ---- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar__filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-3);
}

/* ---- Pipeline (lead aşamaları) ---- */
.pipeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.pipeline__col {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 120px;
}
.pipeline__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2);
  margin-bottom: 10px;
}
.pipeline__count {
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-size: 11px;
}
.lead-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
}
.lead-card:hover { border-color: var(--accent); }
.lead-card__name { font-weight: 600; font-size: 14px; }
.lead-card__meta { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.lead-card__value {
  font-family: var(--font-mono);
  color: var(--accent-3);
  font-size: 13px;
  margin-top: 6px;
}

/* ---- Hatırlatıcı / not kartı ---- */
.note-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.note-card.is-done { opacity: 0.55; border-left-color: var(--success); }
.note-card.prio-yuksek { border-left-color: var(--danger); }
.note-card.prio-dusuk { border-left-color: var(--text-muted); }
.note-card__body { flex: 1; }
.note-card__title { font-weight: 600; }
.note-card.is-done .note-card__title { text-decoration: line-through; }
.note-card__sub { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

/* ---- Yapışkan notlar (sticky note panosu) ---- */
.sticky-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  align-items: start;
}
.sticky {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  padding: 14px 16px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.sticky:hover {
  transform: translateY(-3px) rotate(-0.4deg);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38);
}
.sticky.prio-yuksek { border-top-color: var(--danger); }
.sticky.prio-orta { border-top-color: var(--accent); }
.sticky.prio-dusuk { border-top-color: var(--text-muted); }
.sticky.is-done { opacity: 0.5; }

.sticky__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sticky__check,
.sticky__x {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.sticky__check:hover { border-color: var(--success); color: var(--success); }
.sticky__x:hover { border-color: var(--danger); color: var(--danger); }
.sticky.is-done .sticky__check { border-color: var(--success); color: var(--success); }

.sticky__body {
  flex: 1;
  cursor: pointer;
}
.sticky__title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}
.sticky.is-done .sticky__title { text-decoration: line-through; }
.sticky__text {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.sticky__date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: auto;
}

/* ---- İzin satırı + toggle switch (Yetki Ayarları) ---- */
.perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.perm-row:first-of-type { border-top: none; }
.perm-row__label { font-weight: 600; font-size: 14px; }
.perm-row__note { font-size: 12px; margin-top: 2px; }

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch__knob {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background 0.16s ease;
}
.switch__knob::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.16s ease;
}
.switch input:checked + .switch__knob { background: var(--accent); }
.switch input:checked + .switch__knob::before { transform: translateX(18px); }

/* ---- Few-shot örnek listesi (AI Niyet Eğitimi) ---- */
.fewshot-list { display: flex; flex-direction: column; gap: 8px; }
.fewshot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-2, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.fewshot-row__msg {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  word-break: break-word;
}

/* ---- Giriş ekranı (login overlay) ---- */
.login {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(123,122,247,0.18), transparent), var(--bg, #0a0a0f);
}
.login__card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 26px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.login__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.login__title { font-size: 18px; font-weight: 700; }
.login__sub { font-size: 13px; margin-top: 2px; }
.login__error {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  background: rgba(255, 90, 90, 0.12);
  border: 1px solid var(--danger);
  color: var(--danger);
}
.login__note {
  margin-top: 16px;
  font-size: 11px;
  line-height: 1.5;
}

/* ---- Sidebar kullanıcı kutusu ---- */
.userbox { margin-bottom: 4px; }
.userbox__name { font-weight: 600; font-size: 13px; }
.userbox__role { font-size: 11px; margin-top: 1px; }

/* ---- Geliştirme zaman tüneli (panel) ---- */
.tl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.tl-col {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.tl-col-head { font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.tl-line { position: relative; padding-left: 18px; }
.tl-line::before {
  content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px;
  width: 2px; background: var(--border);
}
.tl-item {
  position: relative; cursor: pointer; padding: 8px 8px 12px 4px;
  border-radius: 8px;
}
.tl-item:hover { background: var(--surface-2); }
.tl-dot {
  position: absolute; left: -16px; top: 12px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--text-muted); border: 2px solid var(--bg-1);
}
.tl-item.prio-yuksek .tl-dot { background: var(--danger); }
.tl-item.prio-orta .tl-dot { background: var(--accent); }
.tl-item.prio-dusuk .tl-dot { background: var(--text-muted); }
.tl-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tl-tip { font-size: 11px; color: var(--text-muted); }
.tl-title { font-weight: 600; font-size: 14px; }
.tl-meta { font-size: 12px; margin-top: 3px; }
.tl-note { font-size: 12px; color: var(--text-2); margin-top: 5px; line-height: 1.5; }

/* ============ BEYİN PANELİ — ZENGİN DASHBOARD ============ */
.hero {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); border-radius: 18px;
  background:
    radial-gradient(900px 300px at 80% -40%, rgba(123,122,247,.25), transparent),
    linear-gradient(135deg, var(--surface), var(--surface-2));
  padding: 26px 28px; margin-bottom: 20px;
}
.hero__glow {
  position: absolute; inset: 0;
  background: radial-gradient(400px 200px at 15% 120%, rgba(61,220,151,.12), transparent);
  pointer-events: none;
}
.hero__content { position: relative; z-index: 1; }
.hero__eyebrow { font-size: 11px; letter-spacing: .18em; color: var(--accent-3); font-weight: 700; }
.hero__title { font-size: 26px; font-weight: 800; margin: 6px 0 4px; }
.hero__sub { font-size: 14px; }
.hero__chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.hero__chip {
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--text-2);
}
.hero__chip--warn { color: var(--warning); border-color: var(--warning); }

.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.kpi {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: 14px; padding: 16px;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
.kpi::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0; transition: opacity .15s ease;
}
.kpi:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.kpi:hover::before { opacity: 1; }
.kpi__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.kpi__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent-soft, rgba(123,122,247,.12)); color: var(--accent-3); font-size: 15px;
}

.chart-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px; margin-bottom: 20px;
}
.chart-card { padding: 16px 18px; }

.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.health-item { display: flex; align-items: center; gap: 10px; }
.health-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 8px currentColor; }

/* ---- Müşteri veri özeti çipleri ---- */
.data-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 8px 12px; border-radius: 10px;
  background: var(--bg-1); border: 1px solid var(--border);
}
.data-chip__num { font-family: var(--font-mono); font-weight: 800; font-size: 16px; color: var(--accent-3); }
.data-chip__lbl { font-size: 12px; color: var(--text-muted); }

/* ============ İNCELİK DOKUNUŞLARI (referans CRM'lerden) ============ */
/* Akan şerit (marquee) — topbar üstü motivasyon/sistem mesajı */
.marquee {
  height: 30px; overflow: hidden; position: relative;
  background: linear-gradient(90deg, rgba(123,122,247,.18), rgba(61,220,151,.12));
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.marquee__track {
  display: inline-flex; white-space: nowrap; gap: 60px;
  padding-left: 100%; animation: marqueeMove 30s linear infinite;
  font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: .03em;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marqueeMove { to { transform: translateX(-100%); } }

/* Modal giriş animasyonu */
@keyframes modalIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }
.modal { animation: modalIn .2s ease; }

/* Toast bildirim */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 240px; max-width: 360px; padding: 12px 16px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: 13px; animation: toastIn .28s ease;
}
.toast--success { border-left-color: var(--success); }
.toast--error { border-left-color: var(--danger); }
.toast--warning { border-left-color: var(--warning); }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }

/* Zengin boş durum */
.empty { padding: 48px 20px; text-align: center; }
.empty__icon { font-size: 40px; opacity: .5; margin-bottom: 12px; }
.empty__title { font-weight: 700; font-size: 15px; }
.empty__text { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
