/* YanitX renkleri logodan alınmıştır: lacivert zemin, mor ve camgöbeği. */
:root {
  /* Grafik renkleri: doğrulanmış paletin ilk iki rengi (renk körlüğü ve kontrast denetiminden geçti). */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --brand-navy: #040d33;
  --brand-navy-2: #101a4d;
  --brand-cyan: #00cafd;
  /* Beyaz yazı camgöbeği üzerinde okunmaz; düğme geçişi maviye kadar iner. */
  --brand-gradient: linear-gradient(100deg, #6e21ef, #1f6fe8);
  --bg: #f3f4fb;
  --surface: #ffffff;
  --surface-2: #eceefa;
  --text: #131a3f;
  --muted: #565f85;
  --border: #dcdff0;
  --accent: #5a23d9;
  --accent-text: #ffffff;
  --accent-soft: #ebe6fe;
  --warn: #8a5a00;
  --warn-soft: #fbf1da;
  --danger: #a8322a;
  --danger-soft: #fae6e3;
  --bubble-in: #ffffff;
  --bubble-out: #e3e2ff;
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --series-1: #3987e5;
    --series-2: #d95926;
    --bg: #070c2b;
    --surface: #10173d;
    --surface-2: #1a2251;
    --text: #e9ecfb;
    --muted: #a3acd4;
    --border: #2b3468;
    --accent: #ab9dff;
    --accent-text: #0a0e2c;
    --accent-soft: #272463;
    --warn: #e6b65c;
    --warn-soft: #3a2f16;
    --danger: #f08a80;
    --danger-soft: #41211e;
    --bubble-in: #1a2251;
    --bubble-out: #2f2b75;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 8px; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

button, input, textarea, select { font: inherit; color: inherit; }

button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}
button:hover:not(:disabled) { background: var(--surface-2); }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--brand-gradient); border: 0; color: #fff; font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--brand-gradient); filter: brightness(1.12); }
button.danger { color: var(--danger); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
label .hint { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=time], input[type=date], textarea, select {
  display: block;
  width: 100%;
  margin-top: 4px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 400;
}
textarea { min-height: 72px; resize: vertical; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.notice { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.notice.ok { background: var(--accent-soft); }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1 1 200px; min-width: 0; }
.grow input { margin-top: 0; }

/* Giriş */
.auth-page {
  min-height: 100vh;
  padding: 32px 16px;
  background:
    radial-gradient(520px 360px at 18% 12%, rgba(110, 33, 239, .38), transparent 70%),
    radial-gradient(520px 360px at 86% 88%, rgba(0, 202, 253, .22), transparent 70%),
    var(--brand-navy);
}
.auth { max-width: 400px; margin: 0 auto; }
.auth-logo { margin: 0 0 4px; text-align: center; }
.auth-logo img { display: inline-block; }
.auth-tagline { color: #cfd6f5; text-align: center; margin-bottom: 20px; }
.auth-links, .nav-links, .legal-links { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; }
.auth-links { justify-content: center; }
.auth-links a, .nav-links a { color: #cfd6f5; }
.nav-links { padding: 10px 10px 0; }
.forgot { margin: 14px 0 0; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.consent input { flex: none; margin-top: 4px; }
.privacy-tools { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }

/* Yasal sayfalar */
.legal { max-width: 760px; margin: 0 auto; padding: 32px 16px 48px; }
.legal h2 { margin-top: 28px; }
.legal li { margin-bottom: 6px; }
.legal-links { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); }

/* Yerleşim */
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
/* Menü iki temada da laciverttir: logonun beyaz yazısı açık zeminde okunmaz. */
.nav { background: var(--brand-navy); color: #fff; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav .brand { padding: 0 10px; }
.nav .brand img { display: block; }
.nav .company { padding: 6px 10px 16px; margin-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, .18); color: #fff; font-size: 18px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.nav button { width: 100%; text-align: left; border: 0; background: none; color: #dfe3f8; display: flex; justify-content: space-between; align-items: center; }
.nav button:hover:not(:disabled) { background: var(--brand-navy-2); color: #fff; }
.nav button.active, .nav button.active:hover:not(:disabled) { background: linear-gradient(90deg, rgba(110, 33, 239, .75), rgba(31, 111, 232, .45)); color: #fff; font-weight: 600; }
.nav :focus-visible { outline-color: var(--brand-cyan); }
.nav .spacer { flex: 1; }
.nav-menu { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-toggle, .company-top { display: none; }
.nav .nav-toggle .badge { margin-left: 8px; }
.badge { background: var(--danger); color: #fff; border-radius: 999px; font-size: 12px; padding: 0 7px; font-weight: 600; }
.main { padding: 24px; max-width: 900px; width: 100%; }
.main.wide { max-width: none; }

@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .nav { padding: 8px 16px; }
  .nav-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .nav .brand { padding: 0; }
  .nav .brand img { width: 56px; height: 56px; }
  .nav .nav-toggle { display: inline-flex; width: auto; gap: 6px; justify-content: center; border: 1px solid rgba(255, 255, 255, .35); font-weight: 600; color: #fff; }
  .nav-menu { display: none; padding-top: 8px; }
  .nav.open .nav-menu { display: flex; }
  .nav .company { display: none; }
  .nav .company-top { display: block; flex: 1; min-width: 0; font-size: 18px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
  .nav .nav-toggle { flex-shrink: 0; }
  .nav .spacer { display: none; }
  .main { padding: 16px; }
}

/* Mod göstergesi */
.status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-2); }
.status-pill.on { background: var(--accent-soft); color: var(--accent); }
.status-pill.warn { background: var(--warn-soft); color: var(--warn); }

/* Kurulum adımları */
.step { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 16px 0; border-top: 1px solid var(--border); }
.step:first-of-type { border-top: 0; }
.step-mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.step.done .step-mark { background: var(--brand-gradient); color: #fff; }
.step.current .step-mark { outline: 2px solid var(--accent); color: var(--accent); }
.step h2 { margin-bottom: 2px; }
.step h3 { margin-top: 22px; }
.channel-title { display: flex; align-items: center; gap: 8px; }
.channel-title img { flex: none; }

/* Çalışma saatleri */
.hours { display: grid; gap: 6px; margin-bottom: 14px; }
.hours-row { display: grid; grid-template-columns: 120px 90px 110px 110px; gap: 8px; align-items: center; }
.hours-row label { margin: 0; font-weight: 400; display: flex; gap: 6px; align-items: center; }
.hours-row input[type=time] { margin: 0; }
@media (max-width: 560px) { .hours-row { grid-template-columns: 1fr 1fr; } }

/* Görüşmeler */
.inbox { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.conv-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.conv-item { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 12px 14px; background: none; }
.conv-item:last-child { border-bottom: 0; }
.conv-item.active { background: var(--accent-soft); }
.conv-item .name { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.conv-item .preview { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: 12px; font-weight: 600; color: var(--warn); }
@media (max-width: 760px) { .inbox { grid-template-columns: 1fr; } }

.thread { display: flex; flex-direction: column; gap: 6px; padding: 14px; background: var(--surface-2); border-radius: 8px; margin-bottom: 12px; max-height: 55vh; overflow-y: auto; }
.bubble { max-width: 80%; padding: 8px 12px; border-radius: 10px; background: var(--bubble-in); align-self: flex-start; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.out { background: var(--bubble-out); align-self: flex-end; }
.bubble.draft { outline: 1px dashed var(--warn); }
.bubble.failed { outline: 1px solid var(--danger); }
.bubble .meta { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.bubble-note { align-self: center; font-size: 13px; color: var(--muted); text-align: center; }

/* Bilgi kaydı */
.entry { border-top: 1px solid var(--border); padding: 12px 0; }
.entry:first-child { border-top: 0; }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 10; max-width: calc(100% - 32px); }
#toast div { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px; }

/* Raporlar */
.report-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.segmented { display: inline-flex; gap: 4px; }
.segmented button.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.report-range { font-weight: 700; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .value { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat .label { color: var(--muted); font-size: 13px; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.viz-legend .in, .viz-in { background: var(--series-1); fill: var(--series-1); }
.viz-legend .out, .viz-out { background: var(--series-2); fill: var(--series-2); }
.viz-chart { width: 100%; height: auto; display: block; }
.viz-grid { stroke: var(--border); stroke-width: 1; }
.viz-axis { fill: var(--muted); font-size: 11px; }
.viz-hit { fill: transparent; }
.viz-hit:hover { fill: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.report-table th, .report-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.report-table th:first-child, .report-table td:first-child { text-align: left; }
.report-table th { color: var(--muted); font-weight: 600; font-size: 13px; }

/* Yardım ve destek */
.faq details { border-bottom: 1px solid var(--border); padding: 10px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; }
