/* KW Borsa — arayüz tasarım sistemi */
:root {
  color-scheme: light;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --surface-3: #eef0f3;
  --line: #e2e5e9;
  --line-strong: #c9ced5;
  --ink: #1a1e23;
  --ink-2: #48525d;
  --muted: #737d88;
  --brand: #b40101;
  --brand-hover: #960101;
  --brand-ink: #ffffff;
  --brand-soft: #fbe9e9;
  --ok: #1a7f37;
  --ok-soft: #e5f4ea;
  --warn: #8a5a00;
  --warn-soft: #fff3d1;
  --danger: #c62828;
  --danger-soft: #fdeaea;
  --info: #1f5fae;
  --info-soft: #e7effa;
  --focus: #2a78d6;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --radius: 12px;
  --radius-sm: 8px;
  /* grafik */
  --chart-surface: #fcfcfb;
  --chart-grid: #e1e0d9;
  --chart-axis: #c3c2b7;
  --chart-muted: #898781;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  /* bağımsız bölüm durumları */
  --u-musait-bg: #e5f4ea; --u-musait-line: #1a7f37;
  --u-rezerve-bg: #fff3d1; --u-rezerve-line: #b07800;
  --u-kapora-bg: #fde4d6; --u-kapora-line: #c2410c;
  --u-satildi-bg: #e4e7eb; --u-satildi-line: #5b6570;
  --u-kapali-bg: #f3f4f6; --u-kapali-line: #9aa3ad;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1114; --surface: #161a1f; --surface-2: #1b2026; --surface-3: #232931;
    --line: #2a3038; --line-strong: #3a424c; --ink: #e8eaed; --ink-2: #b9c0c8; --muted: #8b949e;
    --brand: #e0393b; --brand-hover: #f05456; --brand-soft: #3a1717;
    --ok: #4cc26c; --ok-soft: #14301c; --warn: #e6b34a; --warn-soft: #33290f; --danger: #ff6b6b;
    --danger-soft: #3a1818; --info: #79aef2; --info-soft: #15263c; --focus: #5598e7;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
    --chart-surface: #1a1a19; --chart-grid: #2c2c2a; --chart-axis: #383835;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181;
    --u-musait-bg: #14301c; --u-musait-line: #4cc26c; --u-rezerve-bg: #33290f; --u-rezerve-line: #e6b34a;
    --u-kapora-bg: #3a1f12; --u-kapora-line: #f08a4b; --u-satildi-bg: #262b31; --u-satildi-line: #8b949e;
    --u-kapali-bg: #1b2026; --u-kapali-line: #5b6570;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1114; --surface: #161a1f; --surface-2: #1b2026; --surface-3: #232931;
  --line: #2a3038; --line-strong: #3a424c; --ink: #e8eaed; --ink-2: #b9c0c8; --muted: #8b949e;
  --brand: #e0393b; --brand-hover: #f05456; --brand-soft: #3a1717;
  --ok: #4cc26c; --ok-soft: #14301c; --warn: #e6b34a; --warn-soft: #33290f; --danger: #ff6b6b;
  --danger-soft: #3a1818; --info: #79aef2; --info-soft: #15263c; --focus: #5598e7;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
  --chart-surface: #1a1a19; --chart-grid: #2c2c2a; --chart-axis: #383835;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181;
  --u-musait-bg: #14301c; --u-musait-line: #4cc26c; --u-rezerve-bg: #33290f; --u-rezerve-line: #e6b34a;
  --u-kapora-bg: #3a1f12; --u-kapora-line: #f08a4b; --u-satildi-bg: #262b31; --u-satildi-line: #8b949e;
  --u-kapali-bg: #1b2026; --u-kapali-line: #5b6570;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono, .num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------ uygulama iskeleti */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; }
.wordmark { font-weight: 900; font-size: 21px; letter-spacing: .3px; color: var(--brand); white-space: nowrap; }
.wordmark span { color: var(--ink); font-weight: 800; }
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .4px; text-transform: uppercase; }
.nav { padding: 6px 10px 20px; display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px;
  padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 500; text-decoration: none;
}
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.nav a .ico { width: 20px; text-align: center; flex: none; }
.nav a .count { margin-left: auto; background: var(--brand); color: #fff; border-radius: 99px; font-size: 11px;
  padding: 1px 7px; font-weight: 700; }
.sidebar-foot { margin-top: auto; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 13px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .menu-btn { display: none; }
.content { padding: 22px 24px 48px; max-width: 1360px; width: 100%; }
.bottom-nav { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 60; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50; }
  .topbar { padding: 10px 16px; }
  .topbar .menu-btn { display: inline-flex; }
  .content { padding: 16px 16px 96px; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px;
    color: var(--muted); padding: 4px 2px; text-decoration: none; position: relative; }
  .bottom-nav a .ico { font-size: 19px; line-height: 1.1; }
  .bottom-nav a.active { color: var(--brand); font-weight: 650; }
  .bottom-nav a .dot { position: absolute; top: 2px; right: calc(50% - 18px); background: var(--brand); color: #fff;
    border-radius: 99px; font-size: 10px; padding: 0 5px; font-weight: 700; }
}

/* ------------------------------------------------ bileşenler */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; min-height: 38px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 600 14px/1.2 inherit; font-family: inherit; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn.lg { min-height: 48px; padding: 12px 18px; font-size: 15px; }
.btn.icon { padding: 6px; min-width: 38px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { flex: 1; }
.card-body { padding: 16px 18px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.page-head { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .lead { color: var(--muted); font-size: 14px; margin-top: 4px; }
.page-head > div:first-child { flex: 1 1 420px; min-width: 220px; }

.chip, .badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px;
  font-weight: 650; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; line-height: 1.6;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 12px; font: 600 13px inherit; font-family: inherit;
  color: var(--ink-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: var(--surface); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font: 600 14px inherit; font-family: inherit;
  color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 8px 11px; min-height: 38px; width: 100%;
}
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--brand); }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; }
label.check input { margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .4px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.empty .big { font-size: 30px; margin-bottom: 6px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--info-soft); color: var(--ink); font-size: 14px; }
.notice.warn { background: var(--warn-soft); }
.notice.danger { background: var(--danger-soft); }
.notice.ok { background: var(--ok-soft); }
.paste-box textarea { min-height: 64px; }
.autofilled { box-shadow: inset 0 0 0 2px var(--ok); }
.notice .ico { flex: none; }
.loading { padding: 48px; text-align: center; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%;
  animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { font-size: 12px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .4px; }
.stat .value { font-size: 26px; font-weight: 750; margin-top: 4px; letter-spacing: -.3px; }
.stat .sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.stat.alert { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: var(--brand-soft); }

/* ------------------------------------------------ Beni Arayanlar */
.call-list { display: flex; flex-direction: column; }
/* Görüşme takibi ve çağrı yönlendirme */
.followup { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.followup:first-of-type { border-top: 0; padding-top: 4px; }
.fw-hit { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); }
.fw-hit.on { border-color: var(--ink); background: var(--surface-2); }
.call {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px;
  border-bottom: 1px solid var(--line); cursor: pointer; text-decoration: none; color: inherit;
}
.call:hover { background: var(--surface-2); text-decoration: none; }
.call:last-child { border-bottom: 0; }
.call .avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 17px;
  background: var(--ok-soft); color: var(--ok); }
.call.missed .avatar { background: var(--danger-soft); color: var(--danger); }
.call .who { font-weight: 650; display: flex; gap: 8px; align-items: center; min-width: 0; }
.call .who .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call .meta { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call .note { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call .when { text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }
.call .when b { display: block; font-size: 13px; color: var(--ink-2); }
.unseen-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }

/* müşteri kartı & hızlı not */
.contact-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.contact-head .big-avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 800; font-size: 20px; flex: none; }
.quick-note { padding: 14px; background: var(--surface-2); border-radius: var(--radius); border: 1px solid var(--line); }
.quick-note textarea { border-radius: 18px; padding: 12px 16px; min-height: 52px; background: var(--surface); }
.status-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.status-buttons .btn { min-height: 46px; }
.st-randevu { border-color: var(--ok) !important; color: var(--ok); }
.st-takipte { border-color: var(--warn) !important; color: var(--warn); }
.st-olumsuz { border-color: var(--danger) !important; color: var(--danger); }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-item .ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px;
  background: var(--surface-3); }
.tl-item .head { font-size: 13px; color: var(--muted); }
.tl-item .body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ilan kartları */
.listing { display: flex; flex-direction: column; overflow: hidden; }
.listing .photo { height: 128px; position: relative; display: flex; align-items: flex-end; padding: 10px 12px; color: #fff;
  background: linear-gradient(135deg, #3d4650, #1e242b); }
.listing .photo.c1 { background: linear-gradient(135deg, #7a2d2d, #2a1414); }
.listing .photo.c2 { background: linear-gradient(135deg, #2c5a7a, #13222f); }
.listing .photo.c3 { background: linear-gradient(135deg, #3d6b4c, #142519); }
.listing .photo.c4 { background: linear-gradient(135deg, #6d5a2e, #261f10); }
.listing .photo .rooms { font-size: 26px; font-weight: 800; letter-spacing: -.5px; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.listing .photo .tag { position: absolute; top: 10px; left: 10px; }
.listing .photo .score { position: absolute; top: 10px; right: 10px; }
.listing .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.listing .title { font-weight: 650; line-height: 1.35; }
.listing .price { font-size: 18px; font-weight: 800; }
.listing .facts { font-size: 13px; color: var(--ink-2); display: flex; gap: 10px; flex-wrap: wrap; }
.listing .foot { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.search-hero { display: flex; gap: 8px; }
.search-hero input { font-size: 17px; min-height: 50px; padding: 10px 16px; border-radius: 12px; }
.search-hero .btn { min-height: 50px; }

/* stok matrisi */
.matrix-wrap { overflow-x: auto; padding-bottom: 6px; }
.block-title { font-weight: 750; margin: 6px 0 8px; display: flex; gap: 8px; align-items: center; }
.matrix { display: grid; gap: 6px; min-width: max-content; }
.matrix .floor { display: grid; grid-template-columns: 56px; grid-auto-flow: column; grid-auto-columns: 132px; gap: 6px; }
.matrix .floor-label { display: grid; place-items: center; font-size: 12px; color: var(--muted); font-weight: 700; text-align: center; }
/* Kat etiketi düğme olduğunda: tıklanınca kat planı açılır (planı yoksa proje ekibi yükler) */
.matrix button.floor-label {
  border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; cursor: pointer;
  font-family: inherit; padding: 2px; line-height: 1.25; align-content: center; gap: 2px;
}
.matrix button.floor-label.has-plan { color: var(--info); border-color: var(--info); }
.matrix button.floor-label.no-plan { border-style: dashed; }
.matrix button.floor-label:hover { background: var(--info-soft); }
.matrix .floor-label .plan-ico { font-size: 13px; font-weight: 400; }
.unit {
  border: 1px solid; border-left-width: 4px; border-radius: 8px; padding: 6px 8px; font-size: 12px; cursor: pointer;
  text-align: left; font-family: inherit; color: var(--ink); line-height: 1.35; min-height: 62px;
}
.unit:hover { filter: brightness(.97); box-shadow: var(--shadow); }
.unit .door { font-weight: 800; font-size: 13px; display: flex; justify-content: space-between; }
.unit .price-row { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.unit .price-row .m2 { font-weight: 800; font-size: 13px; white-space: nowrap; }  /* oda sayısıyla aynı boyut */
.unit .st { font-size: 11px; font-weight: 700; }
.unit.musait { background: var(--u-musait-bg); border-color: var(--u-musait-line); }
.unit.rezerve { background: var(--u-rezerve-bg); border-color: var(--u-rezerve-line); }
.unit.kapora { background: var(--u-kapora-bg); border-color: var(--u-kapora-line); }
.unit.satildi { background: var(--u-satildi-bg); border-color: var(--u-satildi-line); color: var(--ink-2); }
.unit.kapali { border-color: var(--u-kapali-line); color: var(--muted);
  background: repeating-linear-gradient(135deg, var(--u-kapali-bg) 0 6px, var(--surface) 6px 12px); }
.unit.mine { outline: 2px dashed var(--info); outline-offset: 1px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid; border-left-width: 4px;
  vertical-align: -1px; margin-right: 5px; }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; overflow-x: auto; }
.kanban .col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px;
  display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.kanban .col h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-2); display: flex;
  justify-content: space-between; padding: 2px 4px 6px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.kcard .t { font-weight: 700; font-size: 14px; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 700; }
.countdown.urgent { color: var(--danger); }

/* gatekeeper kontrol listesi */
.checklist { display: flex; flex-direction: column; gap: 8px; }
.check-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-2); }
.check-item .mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  font-size: 13px; flex: none; background: var(--danger-soft); color: var(--danger); }
.check-item.done .mark { background: var(--ok-soft); color: var(--ok); }
.check-item .lbl { flex: 1; font-weight: 600; }

.calc-steps { font: 13px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; white-space: pre-wrap; color: var(--ink-2); }
.total-row td { font-weight: 800; background: var(--surface-2); }

/* ajanda */
.day-group { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.day-group:last-child { border-bottom: 0; }
.day-group .date { text-align: center; }
.day-group .date b { display: block; font-size: 24px; line-height: 1; }
.day-group .date span { font-size: 12px; color: var(--muted); text-transform: uppercase; }
.day-group.today .date b { color: var(--brand); }
.agenda-item { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; font-size: 14px; }

/* modal */
dialog.modal { border: 0; padding: 0; border-radius: 16px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog.modal.wide { width: min(860px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(10, 14, 20, .45); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { flex: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; max-height: calc(100vh - 170px); }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* bildirim paneli & toast */
.notif-btn { position: relative; }
.notif-btn .count { position: absolute; top: 2px; right: 2px; background: var(--brand); color: #fff; font-size: 10px;
  font-weight: 800; border-radius: 99px; padding: 0 5px; line-height: 16px; }
.popover { position: absolute; top: 56px; right: 16px; width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 40; }
.popover .item { display: block; padding: 11px 14px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.popover .item:hover { background: var(--surface-2); text-decoration: none; }
.popover .item.unread { background: color-mix(in srgb, var(--brand-soft) 60%, transparent); }
.popover .item b { display: block; font-size: 14px; }
.popover .item span { font-size: 13px; color: var(--ink-2); }
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100;
  max-width: min(420px, calc(100vw - 32px)); }
@media (max-width: 900px) { .toasts { bottom: 84px; left: 16px; right: 16px; } }
.toast { background: var(--ink); color: var(--surface); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg);
  font-size: 14px; animation: rise .2s ease; }
.toast.err { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* giriş */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, var(--brand-soft), transparent), var(--bg); }
.login .card { width: min(440px, 100%); }
.login .wordmark { font-size: 34px; }
.login .auth-title { font-size: 18px; margin: 0 0 4px; }
.auth-switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding-top: 14px; border-top: 1px solid var(--line); }

/* grafikler */
.viz { background: var(--chart-surface); border-radius: var(--radius-sm); }
.viz svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz text { font: 12px system-ui, -apple-system, "Segoe UI", sans-serif; fill: var(--chart-muted); }
.viz .v-label { fill: var(--ink); font-weight: 600; }
.viz .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.viz .axis-line { stroke: var(--chart-axis); stroke-width: 1; }
.viz [data-tip] { cursor: default; }
.viz [data-tip]:hover { opacity: .82; }
.stockbar { display: flex; height: 14px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--chart-surface); }
.stockbar span { display: block; height: 100%; }
.tooltip { position: fixed; z-index: 200; pointer-events: none; background: var(--ink); color: var(--surface);
  padding: 7px 10px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow-lg); white-space: pre; max-width: 320px; }
.hbar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 64px; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; }
.hbar .track { height: 16px; display: flex; align-items: center; }
.hbar .fill { height: 12px; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.switch input { flex: none; appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--line-strong); position: relative;
  cursor: pointer; transition: background .15s; border: 0; padding: 0; min-height: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(16px); }

.doc-row { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.doc-row:last-child { border-bottom: 0; }
.doc-row .name { flex: 1; min-width: 180px; }
.doc-row.old { opacity: .6; }
code.inline { font: 12px ui-monospace, Consolas, monospace; background: var(--surface-3); padding: 2px 6px; border-radius: 5px;
  overflow-wrap: anywhere; }
pre.snippet { font: 12px/1.5 ui-monospace, Consolas, monospace; background: var(--surface-3); padding: 10px 12px;
  border-radius: 8px; overflow-x: auto; margin: 0; }
pre.snippet.wrap { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: 14px; }

/* ------------------------------------------------ tam sürüm bileşenleri */
.card-head.wrap { flex-wrap: wrap; }
/* dar ekranda ızgara hücreleri içeriğin en küçük genişliğine zorlanmasın (taşma olmasın) */
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-auto { grid-template-columns: minmax(0, 1fr); }
  .status-buttons .btn { padding: 6px 4px; font-size: 13px; white-space: normal; }
  .contact-head .btn-row { width: 100%; }
  .contact-head .btn-row .btn { flex: 1; }
  .quick-note .row .btn { width: 100%; }
  .card-head.wrap h2, .card-head.wrap h3 { flex: 1 1 100%; }
  .card-head.wrap input, .card-head.wrap select { max-width: none !important; flex: 1 1 140px; }
  /* telefonda özet kutuları: danışman ekranında yatay şerit (çağrı listesi hemen görünsün), diğerlerinde iki sütun */
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat .value { font-size: 21px; }
  .stats.strip { display: flex; overflow-x: auto; scroll-snap-type: x proximity; margin: 0 -16px 12px; padding: 0 16px 4px; scrollbar-width: none; }
  .stats.strip::-webkit-scrollbar { display: none; }
  .stats.strip .stat { flex: 0 0 58%; scroll-snap-align: start; }
  .page-head { align-items: stretch; }
  .modal-foot .btn { flex: 1 1 auto; }
  .modal-foot .spacer { display: none; }
  .kanban { grid-template-columns: repeat(4, minmax(250px, 82vw)); scroll-snap-type: x proximity; }
  .kanban .col { scroll-snap-align: start; }
}
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
details > summary { cursor: pointer; }
.pos { color: var(--ok); }
.neg { color: var(--danger); }
.err-text { color: var(--danger); }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.section { border-top: 1px solid var(--line); padding-top: 12px; }
.section-title { margin-bottom: 10px; }
.sub-head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 0 0 6px; }
.plain-list { margin: 0; padding-left: 18px; }
.plain-list li { margin: 3px 0; }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.linklike:hover { color: var(--info); text-decoration: underline; }
.row-today td { background: color-mix(in srgb, var(--brand-soft) 60%, transparent); }
.row-muted td { opacity: .6; }
input.mini { width: 72px; min-height: 30px; padding: 2px 6px; text-align: right; }
select.tall { height: auto; padding: 4px; }
.stat .value.pos, .stat .value.neg { font-variant-numeric: tabular-nums; }
.stat-btn { text-align: left; cursor: pointer; font: inherit; color: inherit; }
.stat-btn:hover { border-color: var(--line-strong); }
.stat-btn.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.missed-label { color: var(--danger); font-weight: 700; }
.call .when .btn { margin-top: 4px; }
.wide-cards.grid-auto { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.toolbar { border-top: 1px dashed var(--line); padding-top: 10px; }
.project-card { color: inherit; text-decoration: none; }
.project-card:hover { text-decoration: none; border-color: var(--line-strong); }
.project-card.inactive { opacity: .65; }
.demand { border-top: 1px solid var(--line); padding-top: 10px; }
.stars-inline { color: #d99a06; letter-spacing: 1px; white-space: nowrap; font-size: 15px; }

/* hesap düğmesi (kenar çubuğu) */
.account-btn { display: flex; gap: 10px; align-items: center; width: 100%; background: none; border: 0; padding: 4px; margin: -4px;
  border-radius: var(--radius-sm); font: inherit; color: inherit; cursor: pointer; text-align: left; line-height: 1.3; }
.account-btn:hover { background: var(--surface-3); }
.avatar-sm { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid;
  place-items: center; font-weight: 800; font-size: 13px; flex: none; }

/* ilan fotoğrafı ve detay */
.listing .photo { overflow: hidden; }
.listing .photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.listing .photo .tag, .listing .photo .score, .listing .photo .rooms, .listing .photo .count { z-index: 1; }
.listing .photo .rooms { position: relative; }
.listing .photo .count { position: absolute; right: 10px; bottom: 10px; font-size: 12px; background: rgba(0, 0, 0, .55);
  padding: 2px 8px; border-radius: 99px; }
.cover-btn { display: block; width: 100%; border: 0; padding: 0; background: none; cursor: pointer; text-align: left; font: inherit; }
.listing .title.linklike { font-weight: 650; line-height: 1.35; }
.listing-detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 760px) { .listing-detail { grid-template-columns: 1fr; } }
.gallery { position: relative; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #3d4650, #1e242b); min-height: 220px; }
.gallery.c1 { background: linear-gradient(135deg, #7a2d2d, #2a1414); }
.gallery.c2 { background: linear-gradient(135deg, #2c5a7a, #13222f); }
.gallery.c3 { background: linear-gradient(135deg, #3d6b4c, #142519); }
.gallery.c4 { background: linear-gradient(135deg, #6d5a2e, #261f10); }
.gallery .main { display: block; width: 100%; height: 300px; object-fit: cover; }
.gallery .no-photo { height: 260px; display: grid; place-content: center; text-align: center; color: #fff; font-size: 44px; font-weight: 800; }
.gallery .no-photo small { display: block; font-size: 13px; font-weight: 500; opacity: .8; }
.gallery .thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; background: rgba(0, 0, 0, .45); }
.gallery .thumbs button { flex: none; width: 66px; height: 48px; padding: 0; border: 2px solid transparent; border-radius: 6px;
  overflow: hidden; cursor: pointer; background: #222; }
.gallery .thumbs button.on { border-color: #fff; }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.big-price { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.facts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 0; }
.facts-grid.one { grid-template-columns: 1fr; }
.facts-grid dt { font-size: 12px; color: var(--muted); }
.facts-grid dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* havuz filtreleri ve seçim çubuğu */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { width: auto; max-width: 170px; }
.chip-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 99px; font: 600 13px inherit;
  font-family: inherit; background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-2); cursor: pointer;
  text-decoration: none; white-space: nowrap; }
.chip-btn:hover { background: var(--surface-3); text-decoration: none; }
.chip-btn.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.selection-bar { position: sticky; bottom: 16px; z-index: 15; display: flex; gap: 10px; align-items: center; margin-top: 16px;
  padding: 10px 14px; background: var(--ink); color: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.selection-bar .btn:not(.primary) { background: transparent; color: var(--surface); border-color: color-mix(in srgb, var(--surface) 40%, transparent); }
@media (max-width: 900px) { .selection-bar { bottom: 84px; } }

/* WhatsApp yazışması */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow-y: auto; padding: 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.bubble { max-width: 86%; padding: 8px 12px; border-radius: 14px; font-size: 14px; border: 1px solid var(--line); background: var(--surface); }
.bubble.in { align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, var(--line)); border-bottom-right-radius: 4px; }
.bubble.failed { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.bubble .tpl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); margin-bottom: 2px; }
.bubble .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble .meta { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.bubble .meta .badge { font-size: 10px; padding: 0 6px; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; }
.chat-compose textarea { flex: 1; border-radius: 18px; padding: 10px 14px; min-height: 44px; }

/* evrak görüntüleyici ve imza */
dialog.modal.viewer { width: min(1040px, calc(100vw - 24px)); }
.doc-frame { width: 100%; height: 70vh; border: 0; background: #fff; border-radius: 8px; display: block; }
.doc-image { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 8px; }
.doc-text { white-space: pre-wrap; overflow: auto; max-height: 70vh; margin: 0; font: 13px/1.5 ui-monospace, Consolas, monospace; }
.signature-image { display: block; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; }
.copy-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy-row code.inline { flex: 1; min-width: 200px; padding: 6px 8px; }
.big-code { font-size: 18px !important; padding: 6px 10px !important; letter-spacing: .5px; user-select: all; }

/* proje formu */
.plan-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; align-items: end;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.plan-row .wide { grid-column: 1 / -1; }
.plan-row .plan-remove { grid-column: 2 / -1; text-align: right; }
@media (max-width: 600px) { .plan-row { grid-template-columns: 1fr 1fr; } .plan-row .plan-remove { grid-column: 1 / -1; } }
.mgr-list { display: grid; gap: 4px; max-height: 320px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.mgr-list [hidden] { display: none; }
/* dairedeki ödeme planı düğmeleri: plan adı + tek satırlık özet */
.pay-plans { display: grid; gap: 8px; }
.btn.pay-plan { display: grid; gap: 2px; text-align: left; justify-items: start; height: auto; padding: 8px 12px; white-space: normal; }
/* satış ödeme planı: tutara tıklanınca açılan "alınan ödemeler" kutusu */
.pay-amount { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; white-space: nowrap;
  border-bottom: 1px dashed var(--line-strong); }
.pay-amount:hover { color: var(--brand); border-bottom-color: var(--brand); }
.pay-amount[aria-expanded="true"] { color: var(--brand); }
tr.pay-parts[hidden] { display: none; }
tr.pay-parts > td { padding: 0 0 10px; background: var(--surface-3); }
.pay-parts-box { margin: 8px 12px 0 28px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pay-parts-box .table { margin: 0; }
.text-danger { color: var(--danger); }
tr.pay-total > td { border-top: 2px solid var(--line-strong); background: var(--surface-3); }

/* yönetim paneli */
.progress { height: 10px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: 99px; min-width: 4px; }
.progress.done span { background: var(--ok); }
.pending-strip { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 14px; background: var(--warn-soft);
  border-radius: var(--radius-sm); font-size: 14px; }
a.check-item { color: inherit; text-decoration: none; }
a.check-item:hover { border-color: var(--line-strong); text-decoration: none; }
.onboarding .check-item .mark { background: var(--surface-3); color: var(--muted); }
.onboarding .check-item.done .mark { background: var(--ok-soft); color: var(--ok); }
.viz .target-line { stroke: var(--series-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.target-key { display: inline-block; width: 22px; border-top: 2px dashed var(--series-2); vertical-align: middle; margin-right: 4px; }
.viz.empty-chart { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 14px; }

/* yönetici asistanı: model / efor kaydırıcısı */
#slider { padding: 0; min-height: 28px; accent-color: var(--brand); }
.effort-ticks { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(104px, 1fr); gap: 8px; overflow-x: auto; padding: 4px 0 12px; scroll-snap-type: x proximity; }
.effort-ticks button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; font: 11px inherit;
  font-family: inherit; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; scroll-snap-align: center; min-height: 116px; }
.effort-ticks button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); }
.effort-ticks .mk { font-size: 14px; font-weight: 800; color: var(--muted); }
.effort-ticks .mk.ok { color: #d99a06; }
.effort-ticks .mk.danger { color: var(--danger); }
.assistant-intro, .assistant-selected, .assistant-publish { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.assistant-intro h2 { margin: 6px 0; }
.assistant-selected { padding: 18px; background: var(--surface-2); border-radius: 12px; margin-bottom: 0; }
.assistant-selected h2 { margin: 6px 0 0; font-size: clamp(18px, 3vw, 25px); }
.assistant-score { font-size: 32px; font-weight: 750; text-align: center; text-decoration: none; }
.assistant-score small { display: block; font-size: 11px; font-weight: 500; }
.assistant-scale { display: flex; justify-content: space-between; gap: 12px; }
.assistant-tick-score { margin-top: 8px; font-size: 20px; font-weight: 700; }
.assistant-tick-score small { font-size: 10px; font-weight: 400; }
.assistant-mark.ok { color: #bd8500; }
.assistant-mark.danger { color: var(--danger); }
.assistant-publish { margin-top: 18px; }
.assistant-answer { max-width: 100%; overflow-wrap: anywhere; }
.assistant-log { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow-y: auto; font-size: 13px; }
.effort-ticks button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* hak ediş dökümü ve yazdırma */
.statement { max-width: 900px; }
.signatures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 56px; }
.signatures div { border-top: 1px solid var(--line-strong); padding-top: 6px; text-align: center; font-size: 13px; color: var(--muted); }
@media print {
  .sidebar, .topbar, .bottom-nav, .toasts, .no-print, .tooltip, #notif-pop { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #bbb; break-inside: avoid; }
  .statement { border: 0; padding: 0; max-width: none; }
  a { color: inherit; text-decoration: none; }
}

/* ------------------------------------------------ çalışma ortamı seçici (sol üst: KW Borsa / Demo) */
.brand-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ws-switch { position: relative; }
.ws-switch > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 4px 8px; margin: -4px -8px; border-radius: var(--radius-sm); border: 1px solid transparent; user-select: none; }
.ws-switch > summary::-webkit-details-marker { display: none; }
.ws-switch > summary:hover, .ws-switch[open] > summary { background: var(--surface-3); border-color: var(--line); }
.ws-tag { font-size: 10px; font-weight: 800; letter-spacing: .6px; padding: 2px 6px; border-radius: 6px; line-height: 1.4; }
.ws-tag.live { background: var(--ok-soft); color: var(--ok); }
.ws-tag.demo { background: var(--warn-soft); color: var(--warn); }
.ws-caret { color: var(--muted); font-size: 12px; }
.ws-menu { position: absolute; top: calc(100% + 8px); left: -8px; z-index: 70; width: 280px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; }
.ws-opt { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; }
.ws-opt:hover { background: var(--surface-3); text-decoration: none; }
.ws-opt.on { background: var(--surface-2); }
.ws-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ws-text b { font-size: 14px; }
.brand .ws-text small, .ws-text small { display: block; color: var(--muted); font-size: 12px; text-transform: none; letter-spacing: 0; }
.ws-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ws-dot.live { background: var(--ok); }
.ws-dot.demo { background: var(--warn); }
.ws-check { color: var(--ok); font-weight: 800; }

/* Demo ortamı her zaman belli olsun: üstte uyarı şeridi ve başlık çubuğunda DEMO etiketi */
html.ortam-demo body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 200; pointer-events: none;
  background: repeating-linear-gradient(135deg, var(--warn) 0 14px, var(--warn-soft) 14px 24px); }
.demo-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; background: var(--warn-soft);
  color: var(--warn); font-size: 12px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; text-decoration: none; }
.demo-chip span { font-weight: 600; letter-spacing: 0; }
.demo-chip:hover { text-decoration: none; filter: brightness(.97); }
.demo-users { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-users .btn { flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px 10px; white-space: normal; height: auto; }
.demo-users .btn small { color: var(--muted); font-weight: 500; }
.demo-reset { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
@media (max-width: 600px) { .demo-chip span, .hide-sm { display: none; } }
/* ------------------------------------------------------------------ satış hunisi, kokpitler, organizasyon */
.stage { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 13px; white-space: nowrap; }
.stage::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.stage.yeni::before { background: var(--info); }
.stage.gorusme::before { background: #d6a400; }
.stage.randevu::before { background: #7a5af8; }
.stage.gosterim::before { background: var(--ok); }
.stage.teklif::before { background: #e8730c; }
.stage.pazarlik::before { background: #a53fc4; }
.stage.islem::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.cell-main { font-weight: 650; }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.table td.wrap { white-space: normal; min-width: 150px; max-width: 260px; }
.table .acts { white-space: nowrap; text-align: right; }
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel-step { display: grid; grid-template-columns: 92px minmax(0, 1fr) 46px 64px; gap: 10px; align-items: center; font-size: 14px; }
.funnel-step .bar { height: 22px; border-radius: 4px; background: var(--series-1); min-width: 3px; }
.funnel-step.weak .bar { background: var(--warn); }
.funnel-step .rate { font-size: 12px; color: var(--muted); text-align: right; }
.funnel-step.weak .rate { color: var(--warn); font-weight: 700; }
.goal { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.goal:last-child { border-bottom: 0; }
.goal .progress { grid-column: 1 / -1; height: 8px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.mini-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.mini-table tr:last-child td { border-bottom: 0; }
.delta-up { color: var(--ok); font-weight: 700; white-space: nowrap; }
.delta-down { color: var(--danger); font-weight: 700; white-space: nowrap; }
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pos-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.pos-row:last-child { border-bottom: 0; }
.pos-row .who { flex: 1; min-width: 0; }
.pos-row.child { padding-left: 16px; }
.jd h3 { margin: 18px 0 8px; font-size: 15px; color: var(--brand); }
.jd ul { margin: 0; padding-left: 20px; }
.jd li { margin: 3px 0; }
.jd-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.raci { display: inline-block; min-width: 30px; text-align: center; padding: 1px 6px; border-radius: 4px; font-weight: 700; font-size: 12px;
  background: var(--surface-3); }
.raci.a { background: var(--brand-soft); color: var(--brand); }
.raci.r { background: var(--ok-soft); color: var(--ok); }
.pct-cell { display: inline-flex; align-items: center; gap: 8px; min-width: 96px; }
.pct-cell .progress { flex: 1; height: 7px; min-width: 44px; }
.task-row { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row label { flex: 1; display: flex; gap: 10px; align-items: center; cursor: pointer; }
.task-row.done .t { color: var(--muted); text-decoration: line-through; }
.indicator .target { font-size: 12px; color: var(--muted); }
.indicator.good .value { color: var(--ok); }
.indicator.low .value { color: var(--warn); }
@media (max-width: 720px) {
  .jd-cols { grid-template-columns: 1fr; }
  .funnel-step { grid-template-columns: 74px minmax(0, 1fr) 36px 52px; }
}

/* ---- İlan Kontrol: hareket günlüğü ve kalkış nedeni ---- */
.event-list { display: grid; gap: 8px; margin-top: 8px; }
.event-row { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.event-row .ico { flex: 0 0 auto; font-size: 12px; line-height: 20px; }
.removal-ask { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.removal-row { padding: 8px 0; border-top: 1px solid var(--line); gap: 10px; }
.tabs .badge { margin-left: 4px; }
button.stat { width: 100%; }

/* ofis içi sohbet */
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; height: calc(100vh - 150px); min-height: 420px; }
.chat-list, .chat-pane { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-search { padding: 10px; border-bottom: 1px solid var(--line); }
.chat-threads { overflow: auto; flex: 1; }
.chat-thread { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 12px; background: none; border: 0;
  border-bottom: 1px solid var(--line); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.chat-thread:hover { background: var(--surface-3); }
.chat-thread.on { background: var(--brand-soft); }
.chat-thread-main { flex: 1; min-width: 0; display: grid; }
.chat-thread-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread-side { display: grid; justify-items: end; gap: 4px; flex: none; }
.badge-count { background: var(--brand); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-back { display: none; }
.chat-messages { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.chat-msg { max-width: min(78%, 560px); padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--surface);
  border: 1px solid var(--line); align-self: flex-start; }
.chat-msg.mine { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--brand-soft); border-color: transparent; }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-sender { font-weight: 700; color: var(--brand); }
.chat-time { text-align: right; margin-top: 2px; }
.chat-none { margin: auto; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; max-height: 140px; min-height: 40px; }
.chat-empty { margin: auto; text-align: center; padding: 24px; max-width: 380px; }
.chat-empty .big { font-size: 40px; }
@media (max-width: 800px) {
  .chat { grid-template-columns: 1fr; height: calc(100vh - 190px); }
  .chat .chat-pane { display: none; }
  .chat.open .chat-pane { display: flex; }
  .chat.open .chat-list { display: none; }
  .chat-back { display: inline-flex; }
}

/* ilan haritası (OpenStreetMap karoları, kütüphanesiz) */
.map-card { overflow: hidden; padding: 0; }
.map { position: relative; height: min(62vh, 560px); min-height: 320px; overflow: hidden; background: #dfe6ea; cursor: grab;
  touch-action: none; user-select: none; }
.map.dragging { cursor: grabbing; }
.map-tiles, .map-pins { position: absolute; inset: 0; }
.map-tiles img { position: absolute; left: 0; top: 0; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.map-pin { position: absolute; transform: translate(-50%, -50%); min-width: 30px; height: 30px; padding: 0 7px; border-radius: 99px;
  border: 2px solid #fff; background: var(--brand); color: #fff; font: 700 12px/1 inherit; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.map-pin.approx { background: #fff; color: var(--brand); border: 2px dashed var(--brand); }
.map-pin.on { outline: 3px solid #1a73e8; z-index: 2; }
.map-pin:hover { z-index: 3; }
.map-pin.demo { position: static; transform: none; display: inline-grid; place-items: center; min-width: 22px; height: 22px;
  font-size: 10px; cursor: default; box-shadow: none; margin: 0 4px 0 8px; vertical-align: middle; }
.map-controls { position: absolute; right: 10px; top: 10px; display: grid; gap: 4px; }
.map-controls .btn { min-width: 34px; font-size: 16px; font-weight: 700; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.map-credit { position: absolute; right: 0; bottom: 0; background: rgba(255, 255, 255, .85); font-size: 11px; padding: 2px 6px; }
.map-credit a { color: #333; }
.map-legend { margin: 8px 2px 12px; }
