/* Altındaş CRM — sitenin kimliği: koyu zemin, altın sarısı vurgu, Sora + Inter */
:root {
  --bg: #07090c;
  --surface: #0d1117;
  --surface-2: #131922;
  --surface-3: #1a212c;
  --line: #1f2733;
  --line-strong: #2b3542;
  --text: #e8ecf1;
  --muted: #8899aa;
  --faint: #5d6b7a;
  --accent: #feb320;
  --accent-2: #e08c00;
  --accent-ink: #1a1200;
  --accent-soft: rgba(254, 179, 32, .12);
  --out-bg: #2a2111;
  --out-line: #4a3a17;
  --in-bg: #161c25;
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, .12);
  --warn: #fbbf24;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .12);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .35);
  --radius: 14px;
  --radius-sm: 9px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Sora', 'Inter', system-ui, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f4f6; --surface: #ffffff; --surface-2: #f7f8fa; --surface-3: #eef0f3;
    --line: #e5e7eb; --line-strong: #d4d8de; --text: #18181b; --muted: #52525b; --faint: #8a8f98;
    --accent: #c87818; --accent-2: #a55a00; --accent-ink: #ffffff; --accent-soft: rgba(200, 120, 24, .10);
    --out-bg: #fbf1df; --out-line: #f0d9ad; --in-bg: #ffffff;
    --ok: #059669; --ok-soft: rgba(5, 150, 105, .10); --warn: #b45309; --danger: #dc2626; --danger-soft: rgba(220, 38, 38, .08);
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .06);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f3f4f6; --surface: #ffffff; --surface-2: #f7f8fa; --surface-3: #eef0f3;
  --line: #e5e7eb; --line-strong: #d4d8de; --text: #18181b; --muted: #52525b; --faint: #8a8f98;
  --accent: #c87818; --accent-2: #a55a00; --accent-ink: #ffffff; --accent-soft: rgba(200, 120, 24, .10);
  --out-bg: #fbf1df; --out-line: #f0d9ad; --in-bg: #ffffff;
  --ok: #059669; --ok-soft: rgba(5, 150, 105, .10); --warn: #b45309; --danger: #dc2626; --danger-soft: rgba(220, 38, 38, .08);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -.01em; margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-variant-numeric: tabular-nums; }

/* Üst çubuk */
.topbar { position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 18px; padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: #0b0e13; border: 1px solid #222a35; display: grid; place-items: center; }
.brand-mark img { width: 24px; height: 24px; object-fit: contain; }
.brand-name { font: 600 15px/1.1 var(--font-head); }
.brand-name small { display: block; font: 500 11px/1.3 var(--font); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.tabs { display: flex; gap: 4px; margin-left: 10px; }
.tab { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.tab:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.tab.active { background: var(--accent-soft); color: var(--accent); }
.topbar .spacer { flex: 1; }
.icon-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
  display: inline-grid; place-items: center; cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }

/* Düğmeler, alanlar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); font: 600 14px var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn svg { width: 16px; height: 16px; }
.input, textarea.input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font: inherit; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--faint); }
label.field { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* Rozetler */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--surface-3); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* Avatar */
.avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font: 600 14px var(--font-head); color: #fff; letter-spacing: .02em; }
.avatar.lg { width: 46px; height: 46px; font-size: 15px; }
.av0 { background: linear-gradient(135deg, #b7791f, #8a5a12); } .av1 { background: linear-gradient(135deg, #2f6f73, #1f4c50); }
.av2 { background: linear-gradient(135deg, #5b5ea6, #3d3f78); } .av3 { background: linear-gradient(135deg, #8a4f6c, #64374d); }
.av4 { background: linear-gradient(135deg, #4b7a3f, #33572b); } .av5 { background: linear-gradient(135deg, #6b6f78, #4a4d55); }

/* Sohbet düzeni */
.app { display: grid; grid-template-columns: 380px 1fr; height: calc(100vh - 60px); height: calc(100dvh - 60px); }
.app.has-info { grid-template-columns: 380px 1fr 320px; }
.pane { min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.list-pane { border-right: 1px solid var(--line); background: var(--surface); }
.list-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.list-head h1 { font-size: 18px; display: flex; align-items: baseline; gap: 8px; }
.list-head h1 .count { font: 500 13px var(--font); color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.stat b { display: block; font: 600 17px/1.2 var(--font-head); }
.stat span { font-size: 11.5px; color: var(--muted); }
.stat.hot b { color: var(--accent); }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--faint); }
.search .input { padding-left: 36px; }
.filters { display: flex; gap: 6px; overflow-x: auto; padding-top: 10px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters .chip { height: 28px; padding: 0 11px; font-size: 12.5px; cursor: pointer; }
.filters .chip:hover { color: var(--text); text-decoration: none; }
.filters .chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.list { overflow-y: auto; flex: 1; }
.row { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text); position: relative; }
.row:hover { background: var(--surface-2); text-decoration: none; }
.row.active { background: var(--accent-soft); }
.row.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.row .body { min-width: 0; flex: 1; }
.row .top { display: flex; align-items: baseline; gap: 8px; }
.row .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.row .time { font-size: 12px; color: var(--faint); white-space: nowrap; }
.row.waiting .time { color: var(--accent); font-weight: 600; }
.row .prev { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-top: 2px; }
.row .prev span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.row .prev .wait { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row .tags { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.row .tags .chip { height: 19px; font-size: 11px; padding: 0 7px; }

.chat-pane { background: var(--bg); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-head .who { min-width: 0; flex: 1; }
.chat-head .who b { display: block; font: 600 15.5px var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .who span { font-size: 12.5px; color: var(--muted); }
.chat-head .back { display: none; }
.messages { flex: 1; overflow-y: auto; padding: 18px 6% 28px; display: flex; flex-direction: column; gap: 4px;
  background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--line) 70%, transparent) 1px, transparent 0); background-size: 22px 22px; }
.day { align-self: center; margin: 14px 0 8px; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); position: sticky; top: 6px; z-index: 1; }
.msg { max-width: min(560px, 78%); padding: 8px 12px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--in-bg);
  overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); }
.msg .text { white-space: pre-wrap; }
.msg.in { align-self: flex-start; border-top-left-radius: 4px; }
.msg.out { align-self: flex-end; background: var(--out-bg); border-color: var(--out-line); border-top-right-radius: 4px; }
.msg + .msg.same { margin-top: -1px; }
.msg .meta { display: flex; justify-content: flex-end; gap: 6px; font-size: 11px; color: var(--faint); margin-top: 2px; }
.msg.revoked .text { color: var(--faint); text-decoration: line-through; }
.msg.reaction { background: transparent; border: none; box-shadow: none; font-size: 22px; padding: 0 6px; }
.file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 2px 0 6px; border-radius: 10px; background: color-mix(in srgb, var(--surface-3) 80%, transparent);
  border: 1px solid var(--line); font-size: 13px; }
.file .ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.file .ico svg { width: 17px; height: 17px; }
.file b { display: block; font-weight: 600; }
.older { align-self: center; margin-bottom: 8px; }

.info-pane { border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
.info-pane .sect { padding: 18px; border-bottom: 1px solid var(--line); }
.info-pane h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; font-family: var(--font); font-weight: 600; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-weight: 500; }
.saved { display: flex; align-items: center; gap: 6px; color: var(--ok); font-size: 13px; margin-top: 10px; }
.btn.danger { background: var(--danger); color: #fff; }
.danger-zone summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; list-style: none; }
.danger-zone summary::-webkit-details-marker { display: none; }
.danger-zone summary::before { content: '›'; display: inline-block; width: 14px; transition: transform .15s; }
.danger-zone[open] summary::before { transform: rotate(90deg); }
.danger-zone[open] summary { color: var(--danger); }
.danger-zone p { font-size: 13px; margin: 10px 0 12px; }
.danger-zone .check { margin-bottom: 14px; }
.blocked-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); margin: 0; font-size: 13px; }
.info-toggle { display: none; }

.empty { margin: auto; text-align: center; max-width: 380px; padding: 30px; }
.empty .ill { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty .ill svg { width: 30px; height: 30px; }
.empty h2 { font-size: 17px; margin-bottom: 6px; }
.empty p { color: var(--muted); margin: 0 0 16px; }

/* Sayfa düzeni (durum, bağlama) */
.page { max-width: 1080px; margin: 0 auto; padding: 26px 20px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card h2 { font-size: 15px; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card h2 .ico { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.card h2 .ico svg { width: 16px; height: 16px; }
.card h2 .chip { margin-left: auto; }
.rows { display: grid; gap: 0; }
.rows div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.rows div:last-child { border-bottom: 0; }
.rows dt { color: var(--muted); } .rows dd { margin: 0; text-align: right; font-weight: 500; word-break: break-all; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 99px; }
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); margin-bottom: 16px; font-size: 13.5px; }
.alert > svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert code { font-size: 12.5px; }
.alert.danger { border-color: transparent; background: var(--danger-soft); color: var(--danger); }
.alert.ok { border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font: 600 12.5px var(--font-head); background: var(--accent-soft); color: var(--accent); }
.log p { margin: 6px 0; font-size: 13.5px; }
.ok-t { color: var(--ok); } .err-t { color: var(--danger); }

/* Giriş */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(900px 500px at 50% -10%, rgba(254, 179, 32, .14), transparent 60%), var(--bg); }
.login .card { width: 100%; max-width: 380px; padding: 28px; }
.login .logo { width: 64px; height: 64px; border-radius: 18px; background: #0b0e13; border: 1px solid #222a35; display: grid; place-items: center; margin: 0 auto 16px; }
.login .logo img { width: 44px; height: 44px; object-fit: contain; }
.login h1 { text-align: center; font-size: 20px; }
.login p.sub { text-align: center; color: var(--muted); margin: 4px 0 20px; font-size: 13.5px; }
.login .btn { width: 100%; height: 42px; margin-top: 14px; }
.login .foot { text-align: center; color: var(--faint); font-size: 12px; margin-top: 18px; }

/* Duyarlı */
@media (max-width: 1199px) {
  .app.has-info { grid-template-columns: 340px 1fr; }
  .info-pane { display: none; position: fixed; right: 0; top: 60px; bottom: 0; width: min(360px, 92vw); z-index: 30; box-shadow: -12px 0 30px rgba(0, 0, 0, .35); }
  .info-pane.open { display: block; }
  .info-toggle { display: inline-grid; }
}
@media (max-width: 860px) {
  .topbar { padding: 0 12px; gap: 10px; }
  .brand-name small { display: none; }
  .tabs { margin-left: 0; }
  .app, .app.has-info { grid-template-columns: 1fr; }
  .app.chat-open .list-pane { display: none; }
  .app:not(.chat-open) .chat-pane { display: none; }
  .chat-head .back { display: inline-grid; }
  .chat-head { padding: 10px 12px; gap: 10px; }
  .chat-head .btn span { display: none; }
  .chat-head .btn { width: 36px; padding: 0; }
  .messages { padding: 14px 12px 24px; }
  .msg { max-width: 86%; }
  .page { padding: 18px 14px 50px; }
}

@media (max-width: 480px) {
  .brand-name { display: none; }
  .tab { padding: 7px 10px; }
  .stats { gap: 6px; }
  .stat { padding: 7px 8px; }
  .stat b { font-size: 16px; }
}
