/* CADDE34 CRM — koyu tema. Renkler ofisin lacivert + pirinç (logo) kimliğinden. */
:root {
  --ink: #0d1520;
  --surface: #141f2d;
  --raised: #1b2839;
  --hover: #223248;
  --line: #2a3b52;
  --text: #e9eef4;
  --muted: #93a3b8;
  --faint: #66788f;
  --brass: #e6a83a;
  --brass-ink: #1a1203;
  --brass-soft: rgba(230, 168, 58, .14);
  --green: #4cc08e;
  --green-soft: rgba(76, 192, 142, .14);
  --red: #ec6b62;
  --red-soft: rgba(236, 107, 98, .14);
  --blue: #6ea8e0;
  --blue-soft: rgba(110, 168, 224, .14);
  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 16px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hide { display: none !important; }

/* ---------- kabuk */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.rail { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.mark { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; font: 800 15px/1 var(--font-display); letter-spacing: -.5px;
  color: var(--brass-ink); background: linear-gradient(140deg, #f3c35d, #d98d22); }
.brand b { display: block; font: 700 15px/1.1 var(--font-display); letter-spacing: .3px; }
.brand small { color: var(--muted); font-size: 12px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--radius-s); color: var(--muted); font-weight: 500; }
.nav a svg { width: 19px; height: 19px; flex: none; }
.nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--brass-soft); color: var(--brass); }
.nav .count { margin-left: auto; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700; border-radius: 99px; padding: 0 7px; line-height: 19px; }
.rail .me { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 8px 0; font-size: 13.5px; }
.rail .me b { display: block; }
.rail .me button { margin-top: 8px; }

main { min-width: 0; padding: 26px 34px 90px; max-width: 1240px; width: 100%; }
.head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.head h1 { font: 650 26px/1.15 var(--font-display); margin: 0; letter-spacing: -.3px; }
.head p { margin: 4px 0 0; color: var(--muted); }
.head .grow { flex: 1; }

/* ---------- düğmeler, alanlar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--raised);
  padding: 8px 14px; border-radius: var(--radius-s); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--brass); border-color: var(--brass); color: var(--brass-ink); }
.btn.primary:hover { background: #f0b84e; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 500; }
input.i, select.i, textarea.i { background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 9px 11px; width: 100%; color: var(--text); font-size: 15px; }
textarea.i { min-height: 84px; resize: vertical; }
input.i:focus, select.i:focus, textarea.i:focus { border-color: var(--brass); outline: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 14px; }
.span2 { grid-column: span 2; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.warn { background: var(--red-soft); color: #ffb0a9; border-radius: var(--radius-s); padding: 9px 12px; font-size: 14px; }
.info { background: var(--blue-soft); color: #b9d7f5; border-radius: var(--radius-s); padding: 9px 12px; font-size: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: transparent; padding: 6px 12px; border-radius: 99px; cursor: pointer; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip.on { background: var(--brass-soft); border-color: var(--brass); color: var(--brass); }

/* ---------- rozetler */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--raised); color: var(--muted); white-space: nowrap; }
.tag.hot { background: var(--red-soft); color: var(--red); }
.tag.warm { background: var(--brass-soft); color: var(--brass); }
.tag.cold { background: var(--blue-soft); color: var(--blue); }
.tag.won { background: var(--green-soft); color: var(--green); }
.tag.lost { background: rgba(147, 163, 184, .12); color: var(--faint); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- panel / bloklar */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px 20px; }
.panel h2 { font: 650 16px/1.3 var(--font-display); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.panel h2 .tag { font-weight: 700; }
.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- Bugün: ajanda (sayfanın imza ögesi) */
.agenda { position: relative; }
.agenda .slot { display: grid; grid-template-columns: 64px 1fr; gap: 14px; position: relative; }
.agenda .slot::before { content: ""; position: absolute; left: 77px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.agenda .slot:first-child::before { top: 22px; }
.agenda .slot:last-child::before { bottom: calc(100% - 22px); }
.agenda .time { text-align: right; padding-top: 13px; font: 600 14px/1 var(--font); color: var(--muted); font-variant-numeric: tabular-nums; }
.agenda .slot.late .time { color: var(--red); }
.agenda .card { margin: 4px 0 4px 14px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px;
  display: flex; gap: 12px; align-items: center; position: relative; }
.agenda .card::before { content: ""; position: absolute; left: -20px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface);
  border: 2px solid var(--faint); }
.agenda .slot.late .card::before { border-color: var(--red); background: var(--red); }
.agenda .slot.now .card::before { border-color: var(--brass); background: var(--brass); }
.agenda .slot.late .card { border-color: rgba(236, 107, 98, .45); }
.agenda .who { min-width: 0; flex: 1; }
.agenda .who a { color: var(--text); font-weight: 650; }
.agenda .who small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda .acts { display: flex; gap: 6px; }
.empty { text-align: center; padding: 34px 12px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi b { display: block; font: 650 24px/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi.alert b { color: var(--red); }
.kpi a { color: inherit; }

/* ---------- liste */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 260px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); }
.search input { padding-left: 37px; }
.toolbar select.i { width: auto; min-width: 140px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; }
.li { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; align-items: center;
  padding: 12px 18px; border-top: 1px solid var(--line); color: var(--text); }
.li:first-child { border-top: 0; }
.li:hover { background: var(--raised); text-decoration: none; }
.li .n { font-weight: 650; display: flex; align-items: center; gap: 8px; min-width: 0; }
.li .n span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .new { width: 8px; height: 8px; border-radius: 50%; background: var(--brass); flex: none; }
.late-txt { color: var(--red); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 4px; color: var(--muted); font-size: 14px; }

/* ---------- müşteri detay */
.profile .name { font: 650 25px/1.2 var(--font-display); margin: 0; letter-spacing: -.3px; }
.contact { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.facts { display: grid; grid-template-columns: 112px 1fr; gap: 7px 12px; font-size: 14px; margin: 14px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.need { white-space: pre-wrap; background: var(--ink); border-radius: var(--radius-s); padding: 10px 12px; font-size: 14px; margin-top: 12px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--raised); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); }
.quick button:hover { border-color: var(--brass); }
.quick svg { width: 22px; height: 22px; color: var(--brass); }
.stagebar { display: flex; gap: 4px; margin: 6px 0 2px; flex-wrap: wrap; }
.stagebar button { flex: 1 1 auto; font-size: 12.5px; padding: 7px 8px; border: 1px solid var(--line); background: transparent; border-radius: var(--radius-s); color: var(--muted); cursor: pointer; font-weight: 600; }
.stagebar button.done { color: var(--text); background: var(--raised); }
.stagebar button.on { background: var(--brass); color: var(--brass-ink); border-color: var(--brass); }
.stagebar button.won.on { background: var(--green); border-color: var(--green); color: #052014; }
.stagebar button.lost.on { background: var(--faint); border-color: var(--faint); color: var(--ink); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); color: var(--muted); }
.timeline .ic svg { width: 17px; height: 17px; }
.timeline .ic.k-arama, .timeline .ic.k-gorusme, .timeline .ic.k-yer_gosterme { background: var(--brass-soft); color: var(--brass); }
.timeline .ic.k-whatsapp { background: var(--green-soft); color: var(--green); }
.timeline .ic.k-ulasilamadi { background: var(--red-soft); color: var(--red); }
.timeline .ic.k-asama, .timeline .ic.k-atama { background: var(--blue-soft); color: var(--blue); }
.timeline .t { font-weight: 600; font-size: 14px; }
.timeline .t small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.timeline .note { white-space: pre-wrap; font-size: 14px; color: #cfd8e3; margin-top: 2px; overflow-wrap: anywhere; }
.tasklist { display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; gap: 10px; align-items: center; background: var(--raised); border-radius: var(--radius); padding: 9px 12px; }
.task .tt { flex: 1; min-width: 0; font-size: 14px; }
.task .tt small { display: block; color: var(--muted); }
.task.late .tt small { color: var(--red); }
.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--faint); background: transparent; cursor: pointer; flex: none; display: grid; place-items: center; color: transparent; }
.check:hover { border-color: var(--green); color: var(--green); }
.check svg { width: 14px; height: 14px; }

.match { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.match:first-of-type { border-top: 0; }
.match b { font-weight: 650; }
.match .price { font-weight: 700; color: var(--brass); font-variant-numeric: tabular-nums; }
.match small { color: var(--muted); grid-column: span 2; }

/* ---------- modallar */
.veil { position: fixed; inset: 0; background: rgba(5, 9, 15, .66); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); width: min(560px, 100%); max-height: calc(100vh - 32px);
  overflow: auto; padding: 20px 22px; animation: rise .16s ease-out; }
.modal.wide { width: min(900px, 100%); }
.modal h3 { margin: 0 0 14px; font: 650 19px/1.3 var(--font-display); display: flex; align-items: center; gap: 10px; }
.modal h3 .x { margin-left: auto; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; position: sticky; bottom: -20px; background: var(--surface); padding: 12px 0 4px; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } }
.kinds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.kinds button { padding: 9px 4px; border: 1px solid var(--line); background: var(--raised); border-radius: var(--radius-s); font-size: 13px; font-weight: 600; cursor: pointer; }
.kinds button.on { border-color: var(--brass); background: var(--brass-soft); color: var(--brass); }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--text); color: var(--ink); padding: 10px 18px; border-radius: 99px;
  font-weight: 600; z-index: 80; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); max-width: calc(100vw - 32px); }
.toast.err { background: var(--red); color: #fff; }

/* ---------- tablo (ekip, rapor, aktarma) */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; color: var(--muted); font-weight: 600; font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t td.r, table.t th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr:last-child td { border-bottom: 0; }
.scrollx { overflow-x: auto; }
.bar { height: 8px; border-radius: 99px; background: var(--raised); overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--brass); border-radius: 99px; }

/* ---------- giriş */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(230, 168, 58, .10), transparent 60%), var(--ink); }
.login form { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login .brand { padding: 0 0 6px; }

/* ---------- mobil */
.tabbar { display: none; }
.fab { display: none; }
@media (max-width: 920px) {
  .cols { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  main { padding: 16px 16px 96px; }
  .head h1 { font-size: 22px; }
  .head .btn.primary { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 40; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 600; position: relative; padding: 4px 0; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--brass); }
  .tabbar a:hover { text-decoration: none; }
  .tabbar .count { position: absolute; top: -2px; left: 54%; background: var(--red); color: #fff; font-size: 10.5px; border-radius: 99px; padding: 0 5px; line-height: 16px; }
  .fab { display: grid; place-items: center; position: fixed; right: 16px; bottom: 78px; width: 56px; height: 56px; border-radius: 50%; border: 0;
    background: var(--brass); color: var(--brass-ink); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); z-index: 41; cursor: pointer; }
  .fab svg { width: 26px; height: 26px; }
  .li { grid-template-columns: 1fr auto; padding: 12px 14px; }
  .li .c3, .li .c4 { display: none; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .kinds, .quick { grid-template-columns: repeat(2, 1fr); }
  .agenda .slot { grid-template-columns: 48px 1fr; gap: 10px; }
  .agenda .slot::before { left: 57px; }
  .agenda .card { flex-wrap: wrap; margin-left: 12px; }
  .agenda .card::before { left: -18px; }
  .modal { padding: 18px 16px; }
  .veil { align-items: end; padding: 0; }
  .modal { border-radius: var(--radius-l) var(--radius-l) 0 0; max-height: 92vh; }
}
