/* PesCafem Bot Paneli — "Aurora Glass" premium koyu tema. */
:root {
  --bg: #070b11;
  --bg-2: #0b0f16;
  --text: #f1f2f8;
  --muted: #a2a5bb;
  --faint: #6a6e86;

  --v1: #a5b8ff;   /* accent light */
  --v2: #4f7cff;   /* accent */
  --v3: #3b5bdb;   /* accent deep */
  --indigo: #7c5cff;
  --cyan: #22d3ee;
  --grad: linear-gradient(135deg, #4f7cff 0%, #7c5cff 100%);
  --grad-soft: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(37, 99, 235, 0.14));

  --green: #34d399; --amber: #fbbf24; --red: #fb7185; --blue: #60a5fa;

  /* Cam yüzeyler */
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.07);
  --glass-3: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --hi: inset 0 1px 0 rgba(255, 255, 255, 0.08);

  --sh-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --sh: 0 12px 34px rgba(0, 0, 0, 0.45);
  --sh-lg: 0 28px 70px rgba(0, 0, 0, 0.6);
  --glow: 0 8px 30px rgba(37, 99, 235, 0.4);

  --r: 18px; --r-sm: 13px; --r-xs: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.5, 1);

  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
button, input, select, textarea { font-family: inherit; }

html, body {
  margin: 0; color: var(--text); font-family: var(--sans);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  background: var(--bg); overflow-x: hidden;
}

/* Aurora arka plan */
body::before {
  content: ""; position: fixed; inset: -20% -10% -10% -10%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(48% 42% at 12% 8%, rgba(59, 130, 246, 0.28), transparent 60%),
    radial-gradient(42% 40% at 92% 6%, rgba(37, 99, 235, 0.22), transparent 60%),
    radial-gradient(50% 45% at 78% 96%, rgba(34, 211, 238, 0.1), transparent 60%);
  filter: blur(30px); animation: drift 22s ease-in-out infinite alternate;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 3px 3px; opacity: 0.5;
}
@keyframes drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(-3%, 2%, 0) scale(1.08); } }

a { color: var(--v1); text-decoration: none; }
a:hover { color: #a5b8ff; }
::selection { background: rgba(59, 130, 246, 0.35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.09); border-radius: 20px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.16); background-clip: padding-box; }

/* ===== Animasyonlar ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.94) translateY(6px); } 100% { opacity: 1; transform: none; } }
@keyframes slideRight { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sheen { 0% { transform: translateX(-120%); } 60%, 100% { transform: translateX(120%); } }
.view > * { animation: fadeUp 0.55s var(--ease) both; }
.stat, .item, .rule, .chart-card, .lead-card { animation: fadeUp 0.55s var(--ease) both; }
@media (prefers-reduced-motion: reduce) { *, body::before { animation: none !important; transition: none !important; } }

/* ===== Kabuk ===== */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px;
  background: linear-gradient(180deg, rgba(18, 18, 28, 0.55), rgba(9, 9, 15, 0.55));
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--line);
}
.side-logo { display: flex; align-items: center; gap: 12px; padding: 4px 8px 24px; animation: slideRight 0.5s var(--ease) both; }
.logo-mark {
  width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0; display: grid; place-items: center; color: #fff;
  background: var(--grad); box-shadow: var(--glow), var(--hi); position: relative; overflow: hidden;
}
.logo-mark::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.35), transparent 45%); }
.logo-mark svg { width: 23px; height: 23px; position: relative; }
.logo-name { font-family: var(--display); font-weight: 700; font-size: 18.5px; letter-spacing: -0.4px; display: block; line-height: 1.1;
  background: linear-gradient(120deg, #fff, #c7d2fe); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-sub { font-size: 11.5px; color: var(--faint); letter-spacing: 0.2px; }

.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 13px; position: relative; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  padding: 11px 13px; border-radius: 13px; font-family: var(--sans); font-size: 14px; font-weight: 500;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
  animation: slideRight 0.5s var(--ease) both;
}
.nav-item:nth-child(1){animation-delay:.04s} .nav-item:nth-child(2){animation-delay:.08s}
.nav-item:nth-child(3){animation-delay:.12s} .nav-item:nth-child(4){animation-delay:.16s}
.nav-item:nth-child(5){animation-delay:.2s} .nav-item:nth-child(6){animation-delay:.24s}
.nav-item svg { width: 19px; height: 19px; opacity: 0.75; flex-shrink: 0; transition: transform 0.25s var(--spring), opacity 0.2s; }
.nav-item:hover { color: #fff; background: var(--glass); border-color: var(--line); }
.nav-item:hover svg { transform: scale(1.12); opacity: 1; }
.nav-item.active { color: #fff; background: var(--grad-soft); border-color: rgba(59, 130, 246, 0.28); box-shadow: var(--hi); }
.nav-item.active svg { opacity: 1; color: var(--v1); }
.nav-item.active::before { content: ""; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 12px var(--v2); }

.side-foot { margin-top: auto; padding: 6px; }
.side-status { display: flex; align-items: center; gap: 10px; padding: 12px 13px; border-radius: 13px; background: var(--glass); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.dot-ind { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot-ind.on { background: var(--green); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.15), 0 0 10px var(--green); }
.dot-ind.off { background: var(--faint); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05); }

/* ===== Ana alan ===== */
.main { min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 34px 44px 22px; flex-wrap: wrap; animation: fadeIn 0.5s var(--ease) both; }
.page-head h1 { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -0.7px; margin: 0;
  background: linear-gradient(120deg, #fff 30%, #a5b8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.page-head-actions { display: flex; gap: 10px; }
.view { padding: 4px 44px 64px; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .side-nav { flex-direction: row; }
  .nav-item span { display: none; } .nav-item.active::before { display: none; } .side-foot { display: none; }
  .page-head, .view { padding-left: 20px; padding-right: 20px; }
}

/* ===== Cam kart ===== */
.card {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); padding: 24px;
  box-shadow: var(--sh-sm), var(--hi); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.grid { display: grid; gap: 16px; }
.cols-auto { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .cols-2 { grid-template-columns: 1fr; } }
.section-title { font-family: var(--display); font-size: 15px; font-weight: 600; letter-spacing: -0.2px; margin: 32px 2px 15px; }
.section-title.first { margin-top: 8px; }
.section-hint { font-size: 13px; color: var(--muted); margin: -9px 2px 15px; }

/* Stat kartı */
.stat {
  position: relative; overflow: hidden; padding: 22px;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh-sm), var(--hi); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: transform 0.35s var(--spring), border-color 0.25s, box-shadow 0.25s;
}
.stat::before { content: ""; position: absolute; top: -40%; right: -20%; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(59, 130, 246, 0.16), transparent 70%); }
.stat:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: var(--sh), var(--hi); }
.stat:nth-child(2){animation-delay:.06s} .stat:nth-child(3){animation-delay:.12s} .stat:nth-child(4){animation-delay:.18s}
.stat-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 15px; color: var(--v1); background: var(--grad-soft); border: 1px solid rgba(59, 130, 246, 0.25); box-shadow: var(--hi); }
.stat-ico svg { width: 20px; height: 20px; }
.stat-ico.green { color: var(--green); background: rgba(52, 211, 153, 0.14); border-color: rgba(52, 211, 153, 0.25); }
.stat-ico.blue { color: var(--blue); background: rgba(96, 165, 250, 0.14); border-color: rgba(96, 165, 250, 0.25); }
.stat-ico.amber { color: var(--amber); background: rgba(251, 191, 36, 0.14); border-color: rgba(251, 191, 36, 0.25); }
.stat .n { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -1.2px; line-height: 1; }
.stat .n.sm { font-size: 19px; letter-spacing: -0.4px; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 7px; font-weight: 500; }
.stat .s { font-size: 12px; color: var(--faint); margin-top: 9px; }

/* Grafik kartı */
.chart-card { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--sh-sm), var(--hi); backdrop-filter: blur(16px); }
.chart-card h3 { font-family: var(--display); font-size: 14.5px; font-weight: 600; margin: 0 0 4px; }
.chart-card .cap { font-size: 12.5px; color: var(--faint); margin-bottom: 16px; }
.chart-holder { position: relative; height: 244px; }

/* ===== Butonlar ===== */
.btn {
  appearance: none; cursor: pointer; font-family: var(--sans); position: relative; overflow: hidden;
  border: 1px solid var(--line-2); background: var(--glass-2); color: var(--text);
  border-radius: 12px; padding: 10px 17px; font-size: 13.5px; font-weight: 600; letter-spacing: 0.1px;
  display: inline-flex; align-items: center; gap: 8px; box-shadow: var(--hi);
  transition: transform 0.2s var(--spring), background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn:hover { background: var(--glass-3); border-color: rgba(255, 255, 255, 0.22); transform: translateY(-2px); color: #fff; }
.btn:active { transform: translateY(0) scale(0.98); }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn.primary::after { content: ""; position: absolute; top: 0; left: 0; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent); transform: translateX(-120%); }
.btn.primary:hover { color: #fff; box-shadow: 0 12px 34px rgba(37, 99, 235, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn.primary:hover::after { animation: sheen 0.9s var(--ease); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn.ghost:hover { background: var(--glass); color: #fff; border-color: var(--line); }
.btn.danger { color: var(--muted); }
.btn.danger:hover { border-color: rgba(251, 113, 133, 0.5); color: var(--red); background: rgba(251, 113, 133, 0.1); }
.btn.red { background: linear-gradient(135deg, #fb7185, #e11d48); border: 0; color: #fff; box-shadow: 0 8px 22px rgba(225, 29, 72, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn.red:hover { color: #fff; box-shadow: 0 12px 30px rgba(225, 29, 72, 0.6); }
.btn.sm { padding: 7px 13px; font-size: 12.5px; border-radius: 10px; }
.btn .bico { display: inline-flex; }
.btn .bico svg { width: 15px; height: 15px; }

/* ===== Form ===== */
input, select, textarea {
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line-2); color: var(--text);
  border-radius: 11px; padding: 10px 13px; font-size: 13.5px; font-family: var(--sans);
  transition: border 0.2s, box-shadow 0.2s, background 0.2s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--v2); background: rgba(0, 0, 0, 0.35); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18); }
textarea { width: 100%; resize: vertical; line-height: 1.55; }
select option { background: #14141f; }
.field-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 13.5px; font-weight: 500; }
.switch input { display: none; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); position: relative; transition: 0.25s var(--ease); flex-shrink: 0; border: 1px solid var(--line); }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--sh-sm); transition: 0.28s var(--spring); }
.switch input:checked + .track { background: var(--grad); border-color: transparent; box-shadow: 0 0 14px rgba(59, 130, 246, 0.5); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* ===== İçerikler ===== */
.content-layout { display: grid; grid-template-columns: 372px 1fr; gap: 24px; align-items: start; }
@media (max-width: 980px) { .content-layout { grid-template-columns: 1fr; } }
.list-head { margin-bottom: 14px; } .search { width: 100%; }
.list { display: flex; flex-direction: column; gap: 9px; max-height: 74vh; overflow-y: auto; padding-right: 6px; }

.item {
  text-align: left; cursor: pointer; width: 100%; position: relative;
  background: rgba(255, 255, 255, 0.028); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px;
  box-shadow: var(--hi); transition: transform 0.25s var(--spring), border-color 0.2s, background 0.2s;
}
.item:focus-visible { outline: 2px solid var(--v2); outline-offset: 2px; }
.item:nth-child(1){animation-delay:.02s} .item:nth-child(2){animation-delay:.05s} .item:nth-child(3){animation-delay:.08s}
.item:nth-child(4){animation-delay:.11s} .item:nth-child(5){animation-delay:.14s} .item:nth-child(n+6){animation-delay:.17s}
.item:hover { border-color: var(--line-2); background: var(--glass-2); transform: translateY(-2px); }
.item.sel { border-color: rgba(79, 124, 255, 0.6); background: var(--grad-soft); box-shadow: 0 6px 22px rgba(37, 99, 235, 0.22); }
.item.disabled { opacity: 0.5; }
.item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item-id { font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.3; }
.item-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 500; background: var(--glass-2); border: 1px solid var(--line); color: var(--muted); }
.chip.cat { color: var(--v1); background: var(--grad-soft); border-color: rgba(59, 130, 246, 0.3); }
.chip.img { color: var(--blue); background: rgba(96, 165, 250, 0.14); border-color: transparent; }
.chip.miss { color: var(--red); background: rgba(251, 113, 133, 0.14); border-color: transparent; }
.chip.on { color: var(--green); background: rgba(52, 211, 153, 0.14); border-color: transparent; }
.chip.off { color: var(--faint); }

/* ===== Facebook önizleme ===== */
.preview-wrap { position: sticky; top: 24px; }
.pv-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.variant-dots { display: flex; gap: 6px; }
.dot { min-width: 32px; height: 32px; padding: 0 9px; border-radius: 10px; cursor: pointer; border: 1px solid var(--line-2); background: var(--glass-2); color: var(--muted); font-size: 13px; font-weight: 600; font-family: var(--sans); transition: all 0.2s var(--spring); }
.dot:hover { color: #fff; border-color: rgba(255, 255, 255, 0.25); transform: translateY(-1px); }
.dot.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--glow); }

.fb { background: #fff; color: #050505; border-radius: 16px; overflow: hidden; box-shadow: var(--sh-lg); max-width: 545px; animation: popIn 0.45s var(--spring) both; font-family: -apple-system, "Segoe UI", Roboto, sans-serif; }
.fb-head { display: flex; align-items: center; gap: 10px; padding: 15px 16px 10px; }
.fb-avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--grad); }
.fb-avatar svg { width: 23px; height: 23px; }
.fb-name { font-weight: 700; font-size: 15px; color: #050505; line-height: 1.15; }
.fb-sub { font-size: 12px; color: #65676b; display: inline-flex; align-items: center; gap: 4px; margin-top: 1px; }
.fb-globe { display: inline-flex; } .fb-globe svg { width: 12px; height: 12px; stroke: #65676b; }
.fb-menu { color: #65676b; display: flex; align-self: flex-start; } .fb-menu svg { width: 20px; height: 20px; }
.fb-body { padding: 4px 16px 14px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.fb-body .fb-tag { color: #1877f2; }
.fb-media { display: grid; gap: 2px; background: #e4e6eb; }
.fb-media.n1 { grid-template-columns: 1fr; } .fb-media.n2, .fb-media.n3, .fb-media.n4 { grid-template-columns: 1fr 1fr; }
.fb-media img { width: 100%; height: 100%; max-height: 340px; object-fit: cover; display: block; }
.fb-media .more { position: relative; } .fb-media .more span { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,0.5); color: #fff; font-size: 26px; font-weight: 700; }
.fb-link { background: #f0f2f5; border-top: 1px solid #dadde1; padding: 12px 16px; font-size: 12px; color: #65676b; }
.fb-link b { display: block; color: #050505; font-size: 14px; margin-bottom: 1px; }
.fb-actions { display: flex; border-top: 1px solid #dadde1; padding: 4px 8px; }
.fb-actions div { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px; color: #65676b; font-size: 14px; font-weight: 600; border-radius: 8px; transition: background 0.15s; cursor: pointer; }
.fb-actions div:hover { background: #f0f2f5; }
.fa-ico { display: inline-flex; } .fa-ico svg { width: 19px; height: 19px; }

/* Düzenleyici */
.editor { margin-top: 20px; }
.editor .row-wrap { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.editor .sep { width: 1px; height: 26px; background: var(--line); }
.editor-actions { display: flex; gap: 9px; margin-top: 14px; flex-wrap: wrap; align-items: center; }

/* ===== Tablo ===== */
.table-card { padding: 8px 10px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 13px 15px; }
th { color: var(--faint); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px; border-bottom: 1px solid var(--line); }
tbody td { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.15s; } tbody tr:hover { background: var(--glass); }
.newday td { border-top: 1px solid var(--line-2); }
.dayname { font-weight: 700; } .daydate { font-size: 11.5px; color: var(--faint); }

/* ===== Yorum kuralları ===== */
.rule { border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 12px; background: var(--glass); box-shadow: var(--hi); backdrop-filter: blur(14px); transition: border-color 0.2s, transform 0.25s var(--spring); }
.rule:hover { border-color: var(--line-2); transform: translateY(-2px); }
.rule h4 { font-family: var(--display); margin: 0 0 11px; font-size: 15px; font-weight: 600; }
.kw { display: inline-block; padding: 4px 11px; margin: 0 5px 6px 0; border-radius: 999px; font-size: 12px; background: var(--glass-2); border: 1px solid var(--line); color: var(--muted); }
.reply-ex { margin-top: 11px; padding: 12px 15px; border-radius: 12px; background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.22); color: #b6f0d9; font-size: 13.5px; line-height: 1.5; }
.escbox { border-color: rgba(251, 113, 133, 0.28); background: rgba(251, 113, 133, 0.08); }
.escbox .kw { background: rgba(251, 113, 133, 0.1); border-color: rgba(251, 113, 133, 0.25); color: #fda4b0; }

/* ===== Leadler (CRM) ===== */
.lead-filters { display: flex; gap: 7px; flex-wrap: wrap; margin: 4px 0 20px; }
.lead-filters .fbtn { appearance: none; cursor: pointer; font-family: var(--sans); border: 1px solid var(--line); background: var(--glass); color: var(--muted); border-radius: 999px; padding: 8px 15px; font-size: 13px; font-weight: 600; transition: all 0.2s var(--ease); display: inline-flex; align-items: center; gap: 8px; }
.lead-filters .fbtn:hover { color: #fff; border-color: var(--line-2); transform: translateY(-1px); }
.lead-filters .fbtn.active { background: var(--grad-soft); color: var(--v1); border-color: rgba(59, 130, 246, 0.4); box-shadow: var(--hi); }
.lead-filters .fbtn .cnt { background: rgba(255, 255, 255, 0.1); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 11px; min-width: 20px; text-align: center; }

.lead-card { display: grid; grid-template-columns: 4px 1fr auto; align-items: stretch; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 11px; overflow: hidden; box-shadow: var(--hi); backdrop-filter: blur(14px); transition: border-color 0.2s, transform 0.25s var(--spring); }
.lead-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.lead-strip { width: 4px; }
.lead-body { padding: 15px 17px; min-width: 0; }
.lead-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lead-name { font-weight: 700; font-size: 15px; }
.lead-msg { color: var(--muted); font-size: 13px; margin-top: 7px; line-height: 1.45; }
.lead-meta { color: var(--faint); font-size: 11.5px; margin-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.lead-note { margin-top: 11px; } .lead-note input { width: 100%; font-size: 12.5px; padding: 8px 11px; }
.lead-side { padding: 15px 17px; display: flex; flex-direction: column; gap: 9px; align-items: flex-end; justify-content: space-between; border-left: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.lead-actions { display: flex; gap: 6px; }
.status-select { font-size: 12.5px; padding: 7px 11px; border-radius: 9px; font-weight: 600; }
.src-badge { font-size: 11px; padding: 3px 10px; border-radius: 999px; font-weight: 600; letter-spacing: 0.2px; }
.src-comment { color: var(--blue); background: rgba(96, 165, 250, 0.14); }
.src-dm { color: var(--v1); background: var(--grad-soft); }
.src-manual { color: var(--muted); background: var(--glass-2); }
.src-lead-ad { color: var(--amber); background: rgba(251, 191, 36, 0.14); }
.lead-card.st-new .lead-strip { background: var(--blue); }
.lead-card.st-contacted .lead-strip { background: var(--amber); }
.lead-card.st-demo .lead-strip { background: var(--v2); }
.lead-card.st-customer .lead-strip { background: var(--green); }
.lead-card.st-lost .lead-strip { background: var(--faint); }
.wa-btn { background: linear-gradient(135deg, #25d366, #12a150) !important; border: 0 !important; color: #fff !important; box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35) !important; }
.wa-btn:hover { box-shadow: 0 10px 24px rgba(37, 211, 102, 0.5) !important; }

/* ===== Modal ===== */
.modal-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(4, 4, 8, 0.6); backdrop-filter: blur(10px); display: grid; place-items: center; padding: 24px; animation: fadeIn 0.22s ease both; }
.modal { width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(24, 24, 36, 0.9), rgba(14, 14, 22, 0.92)); border: 1px solid var(--line-2); border-radius: 22px;
  box-shadow: var(--sh-lg), var(--hi); animation: popIn 0.32s var(--spring) both; backdrop-filter: blur(24px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-family: var(--display); font-size: 18px; font-weight: 600; margin: 0; }
.modal-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.modal-x { appearance: none; border: 1px solid var(--line); background: var(--glass); color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; width: 34px; height: 34px; border-radius: 10px; transition: all 0.2s; }
.modal-x:hover { background: var(--glass-3); color: #fff; }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 18px 24px; border-top: 1px solid var(--line); }
.form-group { margin-bottom: 17px; } .form-group:last-child { margin-bottom: 0; }
.form-group > label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.form-group .hint { font-size: 11.5px; color: var(--faint); font-weight: 400; margin-left: 6px; }
.form-group input[type="text"], .form-group textarea, .form-group select { width: 100%; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.img-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 9px; }
.img-opt { position: relative; cursor: pointer; border-radius: 11px; overflow: hidden; border: 2px solid var(--line); aspect-ratio: 1; transition: border-color 0.2s, transform 0.2s var(--spring); }
.img-opt:hover { transform: translateY(-2px); }
.img-opt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-opt.sel { border-color: var(--v2); box-shadow: var(--glow); }
.img-opt .tick { position: absolute; top: 5px; right: 5px; width: 19px; height: 19px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 11px; display: none; place-items: center; }
.img-opt.sel .tick { display: grid; }
.img-opt .nm { position: absolute; left: 0; right: 0; bottom: 0; font-size: 9px; padding: 3px 5px; background: rgba(0, 0, 0, 0.65); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Yardımcılar ===== */
.muted { color: var(--muted); } .faint { color: var(--faint); }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.spinner { text-align: center; padding: 74px; color: var(--faint); font-size: 13.5px; }
.spinner::before { content: ""; display: block; width: 34px; height: 34px; margin: 0 auto 18px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--v2); animation: spin 0.8s linear infinite; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .spread { justify-content: space-between; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 7px 13px; border-radius: 999px; font-weight: 500; border: 1px solid var(--line); background: var(--glass); color: var(--muted); transition: transform 0.2s var(--spring); }
.pill:hover { transform: translateY(-1px); }
.pill.on { color: var(--green); background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.25); }
.pill.off { color: var(--faint); }
.code { font-family: "SFMono-Regular", ui-monospace, "Cascadia Code", Consolas, monospace; background: rgba(0, 0, 0, 0.3); color: var(--v1); border: 1px solid var(--line); border-radius: 11px; padding: 11px 14px; font-size: 12.5px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; transition: all 0.2s; }
.code:hover { border-color: rgba(59, 130, 246, 0.4); background: rgba(59, 130, 246, 0.08); }
.code .copy { color: var(--faint); font-size: 11px; }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(24px); background: rgba(24, 24, 36, 0.95); color: #fff; padding: 14px 24px; border-radius: 14px; font-size: 13.5px; font-weight: 600; opacity: 0; pointer-events: none; transition: all 0.35s var(--spring); z-index: 300; box-shadow: var(--sh-lg); border: 1px solid var(--line-2); backdrop-filter: blur(16px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: rgba(52, 211, 153, 0.5); } .toast.err { border-color: rgba(251, 113, 133, 0.5); }

/* ================= Giriş ekranı ================= */
.login-wrap { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 24px; animation: fadeIn 0.4s var(--ease) both; }
.login-card {
  width: 100%; max-width: 400px; padding: 36px 32px; text-align: center;
  background: linear-gradient(180deg, rgba(24, 24, 36, 0.85), rgba(14, 14, 22, 0.9));
  border: 1px solid var(--line-2); border-radius: 24px; box-shadow: var(--sh-lg), var(--hi);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); animation: popIn 0.42s var(--spring) both;
}
.login-logo { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 18px; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: var(--glow), var(--hi); }
.login-logo svg { width: 30px; height: 30px; }
.login-title { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.login-sub { color: var(--muted); font-size: 13.5px; margin: 6px 0 20px; }
.login-form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.login-form input { width: 100%; padding: 12px 14px; font-size: 14px; }
.login-err { color: var(--red); font-size: 12.5px; min-height: 6px; text-align: left; }

/* ================= Responsive ================= */
@media (max-width: 1080px) {
  .page-head { padding: 30px 32px 20px; }
  .view { padding: 4px 32px 60px; }
}
@media (max-width: 980px) {
  .content-layout { grid-template-columns: 1fr; }
  .list { max-height: none; }
  .preview-wrap { position: static; }
  .fb { max-width: 100%; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; top: 0; z-index: 60; height: auto; flex-direction: row; align-items: center; gap: 6px;
    padding: 10px 14px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .side-logo { padding: 0 8px 0 2px; }
  .logo-sub { display: none; }
  .side-nav { flex-direction: row; gap: 4px; margin-top: 0; }
  .nav-item { padding: 9px 11px; }
  .nav-item span { display: none; }
  .nav-item.active::before { display: none; }
  .side-foot { display: none; }
  .page-head { padding: 20px 18px 14px; }
  .page-head h1 { font-size: 22px; }
  .view { padding: 4px 18px 48px; }
  .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-card table { min-width: 480px; }
  .modal-overlay { padding: 14px; }
}
@media (max-width: 620px) {
  .cols-auto { grid-template-columns: 1fr 1fr; }
  .stat { padding: 16px; }
  .stat .n { font-size: 24px; }
  .stat-ico { width: 34px; height: 34px; margin-bottom: 12px; }
  .lead-card { grid-template-columns: 4px 1fr; }
  .lead-strip { grid-row: 1 / -1; }
  .lead-side { grid-column: 2; border-left: 0; border-top: 1px solid var(--line); background: transparent;
    flex-direction: row; align-items: center; justify-content: space-between; padding: 12px 16px; }
  .editor .sep { display: none; }
  .editor .row-wrap { gap: 12px; }
}
@media (max-width: 440px) {
  .cols-auto { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 20px; }
  .fb-body { font-size: 14px; }
  .btn { padding: 9px 13px; }
  .lead-filters .fbtn { padding: 7px 12px; font-size: 12.5px; }
}
