:root {
  --bg: #f4f6fa; --panel: #fff; --line: #e4e8ef; --line-soft: #eef1f5; --text: #1b2232; --muted: #6b7486;
  --primary: #2453e6; --primary-soft: #e9efff; --primary-text: #1d43bf;
  --green: #15803d; --green-soft: #e3f5e9; --red: #d23b3b; --red-soft: #fde8e8; --amber: #b45309; --amber-soft: #fdf1dc;
  --violet: #6d28d9; --violet-soft: #efe7fd; --blue-soft: #e6f0ff;
  --mine: #dce6ff; --customer: #fff; --note: #fff4cc; --chat-bg: #f0f2f6;
  --radius: 12px; --nav-w: 232px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--primary-text); }
h1, h2, h3, h4 { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.bold { font-weight: 600; color: var(--text) !important; }
.nowrap { white-space: nowrap; }
.error { color: var(--red); min-height: 18px; font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.push { margin-left: auto; }

.btn { border: 1px solid var(--line); background: var(--panel); padding: 8px 14px; border-radius: 9px; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--bg); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; }
.icon-btn { border: 0; background: none; font-size: 17px; cursor: pointer; padding: 6px 8px; border-radius: 8px; line-height: 1; color: inherit; text-decoration: none; }
.icon-btn:hover { background: var(--bg); }

.input, .modal-card input:not([type=checkbox]):not([type=radio]):not([type=file]), .modal-card select, .modal-card textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: var(--panel);
}
.input.sm { padding: 5px 8px; font-size: 13px; width: auto; }
.input:disabled, .modal-card input:disabled { background: var(--bg); color: var(--muted); }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--primary-soft); border-color: var(--primary) !important; }
label { display: block; font-size: 13px; color: var(--muted); }
label > .input, label > input, label > select, label > textarea { margin-top: 4px; color: var(--text); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); align-self: end; padding-bottom: 8px; }
textarea { resize: vertical; }

/* giriş */
.login { height: 100%; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: var(--panel); padding: 28px; border-radius: 16px; box-shadow: 0 10px 40px rgba(20,30,60,.08); display: grid; gap: 14px; }
.login-card input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; margin-top: 4px; }
.brand, .nav-brand { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.logo { background: var(--primary); color: #fff; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; flex: none; }

/* yerleşim */
.app { height: 100%; display: grid; grid-template-columns: var(--nav-w) 1fr; }
.nav { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.nav-brand { padding: 16px 18px; border-bottom: 1px solid var(--line-soft); font-size: 17px; }
.nav-list { padding: 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-list a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--text); text-decoration: none; position: relative; }
.nav-list a i { font-style: normal; width: 20px; text-align: center; opacity: .8; }
.nav-list a:hover { background: var(--bg); }
.nav-list a.active { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; box-shadow: inset 0 0 0 1px #c9d6ff; }
.nav-section { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; padding: 16px 12px 6px; }
.nav-foot { padding: 12px 18px; border-top: 1px solid var(--line-soft); }
.badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px; display: none; align-items: center; justify-content: center; font-weight: 600; }
.badge.show { display: inline-flex; }
.nav-backdrop { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.global-search { position: relative; flex: 1; max-width: 460px; margin-left: auto; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--panel); }
.global-search input { border: 0; outline: 0; padding: 8px 0; flex: 1; min-width: 0; background: none; }
.global-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
kbd { font: 11px system-ui; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; background: var(--bg); }
.search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(20,30,60,.12); z-index: 20; max-height: 360px; overflow-y: auto; }
.search-results button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; cursor: pointer; }
.search-results button:hover { background: var(--bg); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.me-btn { display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; padding: 4px 8px; border-radius: 10px; text-align: left; }
.me-btn:hover { background: var(--bg); }
.me-text { display: flex; flex-direction: column; line-height: 1.25; }

.page { flex: 1; overflow-y: auto; padding: 24px 32px 40px; min-height: 0; }
.page > * { max-width: 1400px; margin-left: auto; margin-right: auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; }
.card-foot { padding: 10px 20px; border-top: 1px solid var(--line-soft); text-align: right; }
.card-foot a { text-decoration: none; font-weight: 500; }

/* avatar & etiketler */
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: #fff; position: relative; font-size: 14px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.xs { width: 24px; height: 24px; font-size: 10px; }
.avatar.ghost { background: var(--bg); color: var(--muted); border: 1px solid var(--line); font-size: 16px; }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--panel); }
.avatar.xs .dot { width: 8px; height: 8px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); border: 1px solid color-mix(in srgb, var(--c) 30%, white); white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--bg); white-space: nowrap; }
.pill.off, .pill.overdue { background: var(--red-soft); color: var(--red); }
.pill.admin { background: var(--primary-soft); color: var(--primary-text); }
.pill.open { background: var(--blue-soft); color: var(--primary-text); }
.pill.done { background: var(--line-soft); color: var(--muted); }
.wait { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); white-space: nowrap; }
.wait.critical { background: var(--red-soft); color: var(--red); }
.new-pill { font-size: 11px; font-weight: 600; color: var(--green); }

/* gösterge paneli */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--text); transition: box-shadow .15s, border-color .15s; }
.kpi:hover { border-color: #cdd5e4; box-shadow: 0 6px 18px rgba(20,30,60,.06); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.kpi-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; }
.kpi-icon.green { background: var(--green-soft); } .kpi-icon.blue { background: var(--blue-soft); } .kpi-icon.amber { background: var(--amber-soft); }
.kpi-icon.red { background: var(--red-soft); } .kpi-icon.violet { background: var(--violet-soft); }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 6px; }
.trend { font-weight: 600; }
.trend.up { color: var(--green); } .trend.down { color: var(--red); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 20px; border-top: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
.table th { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: #fafbfd; }
.table .num { text-align: right; }
.table.clickable tbody tr { cursor: pointer; }
.table tbody tr:hover { background: #fafbfd; }
.table tr.unassigned { background: #fffaf0; }
.row-actions { text-align: right; white-space: nowrap; }

/* sohbet sayfası */
.page-sohbetler, .page-ekip-sohbeti { padding: 0; overflow: hidden; }
.page-sohbetler > *, .page-ekip-sohbeti > * { max-width: none; }
.chat-page { height: 100%; display: grid; grid-template-columns: 340px 1fr; }
.chat-page.wa { grid-template-columns: 240px 360px 1fr; }
.staff-col { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; padding: 12px 0 0; }
.staff-col > .input { margin: 0 12px 8px; width: auto; }
.staff-list { overflow-y: auto; flex: 1; }
.staff-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px 12px; cursor: pointer; text-align: left; border-left: 3px solid transparent; }
.staff-item:hover { background: var(--bg); }
.staff-item.active { background: var(--primary-soft); border-left-color: var(--primary); }
.staff-item .avatar { width: 34px; height: 34px; font-size: 12px; }
.staff-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.staff-text > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { background: var(--line-soft); border-radius: 999px; font-size: 11px; font-weight: 700; min-width: 22px; height: 20px; display: grid; place-items: center; padding: 0 6px; color: var(--text); }
.staff-item.active .count { background: var(--primary); color: #fff; }

.list-col { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.list-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px; gap: 8px; }
.list-head h2 { font-size: 19px; }
.list-tools { padding: 0 16px 8px; display: grid; gap: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 11px; font-size: 12px; cursor: pointer; }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-select { border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; font-size: 12px; background: var(--panel); }
.archive-row { display: flex; align-items: center; gap: 8px; border: 0; border-top: 1px solid var(--line-soft); background: none; padding: 8px 0 0; cursor: pointer; color: var(--muted); text-align: left; }
.archive-row.active { color: var(--primary-text); font-weight: 600; }
.conv-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; overflow-x: hidden; flex: 1; border-top: 1px solid var(--line-soft); }
.conv { display: flex; gap: 12px; padding: 12px 16px; cursor: pointer; border-left: 3px solid transparent; border-bottom: 1px solid var(--line-soft); }
.conv:hover { background: #fafbfd; }
.conv.active { background: var(--primary-soft); border-left-color: var(--primary); }
.conv-body { min-width: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.conv-top, .conv-bottom { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.conv-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 11px; color: var(--muted); flex: none; }
.conv-last { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 3px; }
.unread { background: var(--green); color: #fff; border-radius: 10px; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; flex: none; }
.empty { padding: 24px 16px; text-align: center; }

.chat-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--chat-bg); }
.empty-state { margin: auto; text-align: center; padding: 24px; max-width: 420px; }
.empty-icon { font-size: 30px; width: 64px; height: 64px; border-radius: 16px; background: var(--panel); display: grid; place-items: center; margin: 0 auto 14px; box-shadow: 0 4px 14px rgba(20,30,60,.06); }
.empty-state h3 { margin-bottom: 6px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.chat-head .back { display: none; }
.chat-title { flex: 1; min-width: 0; }
.chat-title h3 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.chat-tags { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px; background: var(--panel); }
.chat-tags:not(:empty) { padding-bottom: 8px; border-bottom: 1px solid var(--line); }

.messages { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; }
.day { align-self: center; font-size: 12px; color: var(--muted); background: var(--panel); padding: 3px 12px; border-radius: 999px; margin: 8px 0; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.msg { position: relative; max-width: min(70%, 600px); padding: 8px 12px; border-radius: 12px; background: var(--customer); box-shadow: 0 1px 2px rgba(0,0,0,.06); align-self: flex-start; word-wrap: break-word; }
.msg .text { white-space: pre-wrap; }
.msg.me { align-self: flex-end; background: var(--mine); }
.msg.note { background: var(--note); border: 1px dashed #e0c25a; }
.msg.system { align-self: center; background: none; box-shadow: none; color: var(--muted); font-size: 12px; padding: 2px; }
.msg .who { font-size: 12px; font-weight: 600; color: var(--primary-text); margin-bottom: 2px; padding-right: 18px; }
.msg.customer .who { color: var(--green); }
.msg.note .who { color: #8a6d00; }
.msg .meta { font-size: 11px; color: var(--muted); text-align: right; margin-top: 2px; }
.msg .meta .failed { color: var(--red); }
.msg-acts { position: absolute; top: 2px; right: 4px; display: flex; gap: 2px; }
.msg .star, .msg .reply-btn { border: 0; background: none; cursor: pointer; color: var(--muted); opacity: 0; font-size: 14px; padding: 2px 3px; border-radius: 5px; }
.msg:hover .star, .msg:hover .reply-btn, .msg .star.on { opacity: 1; }
.msg .reply-btn:hover, .msg .star:hover { background: rgba(0,0,0,.06); }
.msg .star.on { color: #e3a008; }
.msg img { max-width: 100%; max-height: 320px; border-radius: 8px; display: block; margin: 4px 0; cursor: zoom-in; }
.msg audio, .msg video { max-width: 100%; display: block; margin: 4px 0; }
.file-card { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: rgba(255,255,255,.7); border: 1px solid var(--line); border-radius: 10px; margin: 4px 0; min-width: 240px; }
.file-ext { background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 6px; width: 36px; height: 40px; display: grid; place-items: center; flex: none; }
.file-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-info strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.load-more { align-self: center; }

.typing { padding: 0 20px; min-height: 18px; }
.wa-warning { margin: 0 16px 8px; padding: 8px 12px; background: #fff4e5; border: 1px solid #f5c27a; border-radius: 8px; font-size: 13px; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 16px; background: var(--panel); border-top: 1px solid var(--line); }
.composer-main { flex: 1; min-width: 0; }
.composer textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; resize: none; max-height: 160px; display: block; }
.composer.drag { outline: 2px dashed var(--primary); }
.composer.noting textarea { background: var(--note); }
.attach { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 8px; background: var(--bg); border-radius: 6px; margin-bottom: 6px; }
.note-toggle { display: flex; align-items: center; gap: 4px; white-space: nowrap; padding-bottom: 9px; color: #8a6d00; }

/* yıldızlı */
.search-wide { max-width: 520px; margin: 0 0 16px !important; display: block; }
.star-list { display: grid; gap: 14px; }
.star-card .card-head { padding: 12px 16px; }
.star-body { background: var(--chat-bg); padding: 14px 20px; display: flex; flex-direction: column; }
.star-body .msg .msg-acts { display: none; }

/* müşteriler */
.filter-bar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar label { min-width: 170px; }
.segmented { display: inline-flex; background: var(--line-soft); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.segmented button.active { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.modal-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cust-grid { display: grid; grid-template-columns: 1fr 260px; gap: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.form-grid .full { grid-column: 1 / -1; }
.cust-side { border-left: 1px solid var(--line); padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.side-head { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.task-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 320px; overflow-y: auto; }
.task-mini li { display: flex; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 13px; }
.task-mini li:hover { background: var(--bg); }
.task-mini li.overdue { border-color: #f3b6b6; }
.task-mini li.done { opacity: .6; }
.tag-editor { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; }
.tag-pick { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.tag-pick input { margin: 0; }
.tag-editor .tag-new { border: 0 !important; outline: 0 !important; box-shadow: none !important; padding: 4px !important; width: 170px !important; flex: 1; }
.cust-pick { position: relative; }

/* ajanda */
.agenda-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.agenda-bar h2 { font-size: 19px; margin-left: 8px; }
.agenda-bar .input { width: auto; }
.agenda { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }
.mini-cal { padding: 12px; }
.mc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; text-transform: capitalize; }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 12px; }
.mc-grid span { color: var(--muted); padding: 4px 0; }
.mc-grid button { border: 0; background: none; border-radius: 8px; padding: 6px 0; cursor: pointer; }
.mc-grid button:hover { background: var(--bg); }
.mc-grid button.other { color: #b4bac6; }
.mc-grid button.sel { background: var(--primary-soft); }
.mc-grid button.today { background: var(--primary); color: #fff; font-weight: 700; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; padding: 10px 4px; color: var(--muted); }
.lgd { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.lgd.open { background: var(--primary); } .lgd.overdue { background: var(--red); } .lgd.done { background: #b4bac6; }
.agenda-main { overflow: hidden; }
.tg { --hour: 56px; display: flex; flex-direction: column; }
.tg-head, .tg-allday, .tg-body { display: grid; grid-template-columns: 60px repeat(var(--cols), minmax(0, 1fr)); }
.tg-head > div { text-align: center; padding: 10px 4px; border-left: 1px solid var(--line-soft); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tg-head > div:first-child { border-left: 0; }
.tg-head span { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.tg-head b { font-size: 17px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; }
.tg-head .today b { background: var(--primary); color: #fff; }
.tg-allday { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 32px; }
.tg-allday > div { border-left: 1px solid var(--line-soft); padding: 3px; display: flex; flex-direction: column; gap: 2px; }
.tg-allday > div:first-child { border-left: 0; padding: 8px 4px; text-align: right; }
.tg-body { max-height: calc(100vh - 330px); min-height: 360px; overflow-y: auto; position: relative; }
.tg-hours > div { height: var(--hour); font-size: 11px; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.tg-hours > div:first-child { transform: none; }
.tg-col { position: relative; border-left: 1px solid var(--line-soft); cursor: copy; }
.tg-col.today { background: #f8faff; }
.tg-slot { height: var(--hour); border-top: 1px solid var(--line-soft); }
.task-block, .task-chip { position: absolute; left: 3px; right: 3px; border: 0; border-left: 3px solid var(--primary); background: var(--blue-soft); border-radius: 6px; padding: 3px 6px; text-align: left; cursor: pointer; overflow: hidden; font-size: 12px; display: flex; flex-direction: column; line-height: 1.25; }
.task-block span { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-block strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.task-chip { position: static; font-weight: 600; }
.task-block.overdue, .task-chip.overdue { border-left-color: var(--red); background: var(--red-soft); }
.task-block.done, .task-chip.done { border-left-color: #b4bac6; background: var(--line-soft); color: var(--muted); text-decoration: line-through; }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 2; pointer-events: none; }
.tg-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.task-list { padding: 8px 20px 20px; }
.tl-day h4 { text-transform: capitalize; padding: 16px 0 8px; border-bottom: 1px solid var(--line-soft); margin-bottom: 8px; }
.tl-item { display: flex; gap: 14px; align-items: center; width: 100%; border: 1px solid var(--line); border-left: 4px solid var(--primary); background: var(--panel); border-radius: 10px; padding: 10px 14px; margin-bottom: 6px; cursor: pointer; text-align: left; }
.tl-item:hover { background: #fafbfd; }
.tl-item.overdue { border-left-color: var(--red); }
.tl-item.done { border-left-color: #b4bac6; opacity: .7; }
.tl-time { width: 64px; font-weight: 600; flex: none; }
.tl-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }

/* pencereler */
.modal { position: fixed; inset: 0; background: rgba(15,22,40,.45); display: grid; place-items: center; padding: 16px; z-index: 30; }
.modal-card { background: var(--panel); border-radius: 16px; width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; padding: 22px; display: grid; gap: 12px; }
.modal-card.wide { max-width: 860px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; align-items: center; flex-wrap: wrap; }
.pick-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; }
.pick-list label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--text); font-size: 14px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.pick-list label:last-child { border-bottom: 0; }
.pick-list label:hover { background: var(--bg); }
.menu-pop { position: fixed; z-index: 40; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(20,30,60,.14); padding: 4px; min-width: 200px; }
.menu-pop button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; border-radius: 7px; cursor: pointer; }
.menu-pop button:hover { background: var(--bg); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line-soft); margin: 4px 0; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #15203b; color: #fff; padding: 10px 16px; border-radius: 9px; z-index: 50; max-width: calc(100% - 32px); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: grid; place-items: center; z-index: 60; cursor: zoom-out; }
.lightbox img { max-width: 95vw; max-height: 95vh; }

/* dar ekranlar */
@media (max-width: 1280px) {
  .chat-page.wa { grid-template-columns: 200px 320px 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .chat-page.wa { grid-template-columns: 320px 1fr; }
  .chat-page.wa .staff-col { display: none; }
  .agenda { grid-template-columns: 1fr; }
  .agenda-side { display: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .nav { position: fixed; inset: 0 auto 0 0; width: var(--nav-w); z-index: 25; transform: translateX(-100%); transition: transform .2s; }
  .app.nav-open .nav { transform: none; }
  .app.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,22,40,.4); z-index: 24; }
  .menu-btn { display: block; }
  .topbar { padding: 8px 12px; }
  .global-search kbd, .me-text { display: none; }
  .page { padding: 16px; }
  .page-sohbetler, .page-ekip-sohbeti { padding: 0; }
  .chat-page, .chat-page.wa { grid-template-columns: 1fr; }
  .chat-page.has-chat .list-col { display: none; }
  .chat-page:not(.has-chat) .chat-col { display: none; }
  .chat-head { flex-wrap: wrap; }
  .chat-head .back { display: block; }
  .chat-tools { width: 100%; justify-content: flex-start; }
  .msg { max-width: 88%; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 24px; }
  .cust-grid, .form-grid { grid-template-columns: 1fr; }
  .cust-side { border-left: 0; padding-left: 0; }
  .agenda-bar .push { margin-left: 0; }
  .table th, .table td { padding: 10px 12px; }
}

/* ortak ekler */
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.xl { width: 96px; height: 96px; font-size: 34px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--primary-text); cursor: pointer; font: inherit; text-align: left; }
.link-btn:hover { text-decoration: underline; }
.btn.on { background: var(--primary-soft); border-color: #c9d6ff; color: var(--primary-text); }
.filter-bar .grow { flex: 1; min-width: 220px; }
.pill.won { background: var(--green); color: #fff; }
.pill.best { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.info { padding: 9px 12px; border-radius: 9px; font-size: 13px; }
.info.ok { background: var(--green-soft); color: var(--green); }
.info.warn { background: #fff4e5; border: 1px solid #f5c27a; }
.segmented button:disabled { opacity: .45; cursor: not-allowed; }
.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; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { border-bottom-color: var(--primary); color: var(--primary-text); font-weight: 600; }

/* yenileme radarı */
.strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; margin-bottom: 14px; font-size: 13px; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.radar-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.rc { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; text-align: left; }
.rc b { font-size: 28px; }
.rc span { color: var(--muted); font-size: 13px; }
.rc.red b { color: var(--red); } .rc.amber b { color: var(--amber); } .rc.blue b { color: var(--primary); } .rc.green b { color: var(--green); }
.rc.active { box-shadow: 0 0 0 2px var(--primary); }
.radar-actions { text-align: right; white-space: nowrap; }

/* teklifler */
.quote-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.quote-card { padding: 16px; }
.qc-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.qc-items { display: grid; gap: 2px; }
.qc-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.qc-item.best { background: var(--green-soft); }
.qc-item.won { background: #d9f2e2; box-shadow: inset 0 0 0 1px #9fd9b4; }
.qc-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.qi-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.6fr auto; gap: 6px; margin-bottom: 6px; }

/* sohbet: müşteri paneli, bilgi satırı, ayraç */
.chat-col { flex-direction: row !important; }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.chat-info { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.chat-info:empty { display: none; }
.info-chip { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--line-soft); color: var(--muted); }
.info-chip.ok { background: var(--green-soft); color: var(--green); }
.info-chip.warn { background: var(--amber-soft); color: var(--amber); }
.info-chip.bad { background: var(--red-soft); color: var(--red); }
.divider { display: flex; align-items: center; gap: 10px; margin: 10px 0; color: var(--green); font-size: 12px; font-weight: 600; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid #9fd9b4; }
.divider span { border: 1px solid #9fd9b4; border-radius: 999px; padding: 3px 12px; background: var(--panel); }
.cust-panel { width: 320px; flex: none; background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; }
.cust-panel.compact { width: auto; border: 0; }
.cust-panel section { padding: 14px 18px; border-top: 1px solid var(--line-soft); }
.cust-panel.compact section { padding: 10px 0; }
.cp-top { position: relative; text-align: center; padding: 22px 18px 14px; display: grid; justify-items: center; gap: 2px; }
.cp-top h3 { margin-top: 8px; font-size: 18px; }
.cp-close { position: absolute; top: 8px; right: 8px; }
.cp-actions { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-soft); }
.cp-actions button { border: 0; background: none; padding: 12px 4px; cursor: pointer; display: grid; gap: 4px; justify-items: center; font-size: 18px; }
.cp-actions button span { font-size: 12px; color: var(--muted); }
.cp-actions button:hover { background: var(--bg); }
.cp-h { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.cp-h .link-btn { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 12px; }
.cp-item { display: flex; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; cursor: pointer; font-size: 13px; }
.cp-item > span:nth-child(2) { flex: 1; min-width: 0; }
.cp-item:hover { background: var(--bg); }
.cp-note { background: #fafbfd; border: 1px solid var(--line-soft); border-radius: 9px; padding: 8px 10px; margin-bottom: 6px; font-size: 13px; white-space: pre-wrap; }

/* arama */
.call-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(10,14,28,.92); color: #fff; display: grid; place-items: center; }
.call-card { text-align: center; display: grid; gap: 8px; justify-items: center; padding: 24px; }
.call-card.ring .avatar { animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(36,83,230,.6); } 100% { box-shadow: 0 0 0 28px rgba(36,83,230,0); } }
.call-card p, .call-peer p { color: #c8cfdd; margin: 0; }
.call-btns { display: flex; gap: 18px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.cbtn { width: 64px; height: 64px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 24px; cursor: pointer; position: relative; }
.cbtn span { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); font-size: 11px; margin-top: 6px; white-space: nowrap; color: #c8cfdd; }
.cbtn:hover { background: rgba(255,255,255,.24); }
.cbtn.green { background: #16a34a; } .cbtn.red { background: #dc2626; }
.cbtn.off { background: #fff; color: #111; }
.cbtn.on { background: var(--primary); }
.call-stage { position: absolute; inset: 0; display: grid; place-items: center; }
.call-stage #remoteVideo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; display: none; }
.call-stage.has-remote-video #remoteVideo { display: block; }
.call-stage.has-remote-video .call-peer { position: absolute; top: 16px; left: 16px; text-align: left; display: flex; gap: 10px; align-items: center; }
.call-stage.has-remote-video .call-peer .avatar { width: 40px; height: 40px; font-size: 14px; }
.call-stage.has-remote-video .call-peer h2 { font-size: 16px; }
.call-peer { text-align: center; display: grid; justify-items: center; gap: 6px; z-index: 1; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.call-stage #localVideo { position: absolute; right: 16px; bottom: 120px; width: 200px; max-width: 32vw; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px; background: #222; box-shadow: 0 6px 20px rgba(0,0,0,.4); z-index: 2; transform: scaleX(-1); }
.call-stage #localVideo.dim { opacity: .3; }
.call-btns.bar { position: absolute; bottom: 40px; left: 0; right: 0; z-index: 3; margin: 0; }

@media (max-width: 1280px) {
  .cust-panel:not(.compact) { position: absolute; right: 0; top: 0; bottom: 0; z-index: 5; box-shadow: -8px 0 24px rgba(20,30,60,.12); }
  .chat-col { position: relative; }
}
@media (max-width: 1100px) {
  .radar-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .cust-panel:not(.compact) { width: 100%; }
  .qi-row { grid-template-columns: 1fr 1fr; }
  .radar-actions { text-align: left; }
  .call-stage #localVideo { width: 110px; bottom: 130px; right: 12px; }
  .cbtn { width: 56px; height: 56px; font-size: 21px; }
  .call-btns { gap: 14px; }
}

/* teklif cebi */
.tabs a { padding: 10px 14px; border-bottom: 2px solid transparent; text-decoration: none; color: var(--text); white-space: nowrap; }
.tabs a.active { border-bottom-color: var(--primary); color: var(--primary-text); font-weight: 600; }
.tabs.sub-tabs { border-bottom-color: var(--line-soft); }
.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .02em; }
.req { color: var(--red); }
.row.spread { justify-content: space-between; padding: 4px 0; }
.card.pad { padding: 14px 16px; }
.req-list { display: grid; gap: 10px; }
.req-item { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; text-align: left; cursor: pointer; width: 100%; font: inherit; color: inherit; }
.req-item:hover { border-color: #cdd5e4; box-shadow: 0 4px 14px rgba(20,30,60,.05); }
.req-main { display: grid; gap: 2px; min-width: 0; }
.req-side { display: grid; justify-items: end; align-content: center; gap: 6px; flex: none; }
.drawer-bg { position: fixed; inset: 0; background: rgba(15,22,40,.35); z-index: 26; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--bg); z-index: 27; display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(20,30,60,.15); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 16px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.drawer-body { padding: 16px 20px 32px; overflow-y: auto; display: grid; gap: 12px; align-content: start; }
.table.answers th { width: 40%; font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); background: none; }
.table.answers { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.file-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.file-tile { display: flex; gap: 8px; align-items: center; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: inherit; min-width: 0; }
.file-tile img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex: none; }
.file-tile span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.editor-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 14px; flex-wrap: wrap; }
.editor-meta { margin-bottom: 14px; }
.editor { display: grid; grid-template-columns: 200px minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.palette { padding: 12px; display: grid; gap: 4px; position: sticky; top: 0; }
.palette button { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 7px 10px; cursor: pointer; text-align: left; font-size: 13px; }
.palette button:hover { border-color: var(--primary); }
.palette i, .fld i { font-style: normal; width: 22px; text-align: center; color: var(--primary-text); font-weight: 700; }
.fields-col { padding: 14px; }
.fld { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; background: var(--panel); }
.fld.sel { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.fld-main { flex: 1; min-width: 0; display: grid; }
.fld-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.fld-act { display: flex; gap: 2px; opacity: .5; }
.fld:hover .fld-act, .fld.sel .fld-act { opacity: 1; }
.fld-act button { border: 0; background: none; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.fld-act button:hover { background: var(--bg); }
.props-col { padding: 0 14px 14px; position: sticky; top: 0; display: grid; gap: 10px; }
.phone { border: 10px solid #1b2232; border-radius: 28px; overflow: hidden; background: var(--bg); }
.phone-screen { height: 520px; overflow-y: auto; padding: 14px; font-size: 13px; background: #fff; }
.phone-screen h3 { font-size: 16px; margin: 4px 0 10px; }
.phone-screen h4 { margin: 12px 0 4px; }
.pv-field { margin-bottom: 10px; }
.pv-input { height: 30px; border: 1px solid #cfd6e2; border-radius: 7px; margin-top: 4px; font-size: 12px; color: var(--muted); padding: 6px 8px; }
.pv-opt { border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; margin-top: 4px; }
.pv-btn { background: var(--primary); color: #fff; text-align: center; border-radius: 8px; padding: 9px; font-weight: 600; margin-top: 10px; }

/* hazır yanıtlar */
.composer { position: relative; }
.reply-pop { position: absolute; left: 16px; right: 16px; bottom: 100%; margin-bottom: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 -8px 24px rgba(20,30,60,.12); max-height: 300px; overflow-y: auto; z-index: 6; }
.reply-pop button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.reply-pop button.on, .reply-pop button:hover { background: var(--primary-soft); }

/* ayarlar */
.set-group { margin-bottom: 16px; }
.set-head { padding: 14px 18px 8px; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line-soft); }
.set-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 0; border-bottom: 1px solid var(--line-soft); background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.set-item:nth-child(odd) { border-right: 1px solid var(--line-soft); }
.set-item:hover { background: #fafbfd; }
.set-item > span:nth-child(2) { flex: 1; }
.set-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--primary-soft); display: grid; place-items: center; flex: none; }

@media (max-width: 1280px) { .editor { grid-template-columns: 180px minmax(0, 1fr); } .props-col { grid-column: 1 / -1; position: static; } }
@media (max-width: 860px) {
  .editor { grid-template-columns: 1fr; }
  .palette { position: static; grid-template-columns: 1fr 1fr; }
  .set-grid { grid-template-columns: 1fr; }
  .set-item:nth-child(odd) { border-right: 0; }
  .req-item { flex-direction: column; }
  .req-side { justify-items: start; grid-auto-flow: column; }
}

/* müşteri detay sayfası */
.back-link { display: inline-block; margin-bottom: 8px; text-decoration: none; }
.cust-head .person h1 { font-size: 24px; }
.cust-page { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.cust-id { padding: 16px 18px; }
.ci-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ci-head .link-btn { margin-left: auto; }
.ci-sec { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; }
.ci-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.ci-row > span { color: var(--muted); flex: none; }
.ci-row > b { font-weight: 500; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.icon-btn.sm { font-size: 13px; padding: 2px 5px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-grid > div { background: #fafbfd; border: 1px solid var(--line-soft); border-radius: 9px; padding: 8px 10px; display: grid; }
.stat-grid span { font-size: 12px; color: var(--muted); }
.cust-tabs-card { padding: 4px 18px 18px; min-height: 400px; }
.ct-body { display: grid; gap: 8px; align-content: start; }
.ct-body > .btn { justify-self: start; }
.tl-filter { margin: 6px 0 4px; flex-wrap: wrap; }
.timeline { display: grid; }
.tl-date { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.tl-row { display: flex; gap: 12px; padding: 6px 0; }
.tl-row.compact { padding: 4px 0; gap: 8px; }
.tl-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); display: grid; place-items: center; flex: none; font-size: 14px; }
.tl-row.compact .tl-icon { width: 24px; height: 24px; font-size: 12px; }
.tl-end { text-align: center; padding: 16px 0 4px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.media-tile { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: inherit; min-width: 0; }
.media-tile img { width: 100%; height: 130px; object-fit: cover; border-radius: 7px; }
.media-tile .file-ext { width: 100%; height: 130px; font-size: 20px; }
.media-tile span { overflow: hidden; text-overflow: ellipsis; }
.quote-grid.one { grid-template-columns: 1fr; }
.edit-sec { font-weight: 700; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.phone-row { display: grid; grid-template-columns: 1fr 110px auto; gap: 6px; margin-bottom: 6px; }
.chip-check { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--text); cursor: pointer; }
.chip-check input { margin: 0; }
.consent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cp-facts { margin: 0 18px 12px; padding: 10px 12px; background: #fafbfd; border: 1px solid var(--line-soft); border-radius: 10px; display: grid; gap: 3px; font-size: 13px; }
.cp-facts span { color: var(--muted); }
.cp-item.ellip strong, .ellip { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
a.cp-item { text-decoration: none; color: inherit; }

/* alıntılı yanıt, sekmeler */
.quote-block { border-left: 3px solid var(--primary); background: rgba(36,83,230,.07); border-radius: 6px; padding: 4px 8px; margin: 2px 26px 4px 0; font-size: 12px; cursor: pointer; }
.quote-block b { color: var(--primary-text); font-weight: 600; }
.quote-block div { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg.customer .quote-block { border-left-color: var(--green); }
.reply-preview { display: flex; align-items: center; gap: 8px; padding: 6px 16px 0; background: var(--panel); }
.reply-preview .quote-block { flex: 1; margin: 0; cursor: default; }
.compose-tabs { display: flex; align-items: center; gap: 4px; padding: 8px 16px 0; background: var(--panel); border-top: 1px solid var(--line); }
.compose-tabs button { border: 0; background: none; padding: 5px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--muted); }
.compose-tabs button.on { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.compose-tabs button[data-m=note].on { background: var(--note); color: #8a6d00; }
.compose-tabs .small { margin-left: auto; }
.compose-tabs:not(.hidden) + .reply-preview + .composer, .compose-tabs:not(.hidden) ~ .composer { border-top: 0; }
.msg.flash { box-shadow: 0 0 0 3px #f5c27a; transition: box-shadow .3s; }
.btn.take { padding: 2px 10px; font-size: 12px; margin-left: auto; }

@media (max-width: 1100px) { .cust-page { grid-template-columns: 1fr; } .consent-grid { grid-template-columns: 1fr 1fr; } }

.cust-page > * { min-width: 0; }
.ci-row { flex-wrap: wrap; }

/* grafikler (renkler doğrulandı: mavi gelen, turuncu giden) */
:root { --series-1: #2a78d6; --series-2: #eb6834; }
.pad { padding: 0 20px 16px; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.chart-card.wide { grid-column: 1 / -1; }
.segmented.sm button { padding: 4px 10px; font-size: 12px; }
.chart-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; padding: 0 20px 18px; }
.chart-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 13px; flex-wrap: wrap; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.legend i, .chart-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; overflow: visible; }
.chart-wrap .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart-wrap .tick { font-size: 10px; fill: var(--muted); }
.chart-wrap .hit { fill: transparent; }
.chart-wrap .col.on .hit { fill: rgba(36,83,230,.06); }
.chart-tip { position: absolute; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(20,30,60,.12); padding: 8px 10px; font-size: 12px; pointer-events: none; min-width: 120px; display: grid; gap: 2px; }
.chart-tip b { float: right; margin-left: 12px; }
.chart-table summary { cursor: pointer; color: var(--primary-text); margin-top: 6px; }
.hbars { display: grid; gap: 6px; }
.hbar { display: grid; grid-template-columns: 110px 1fr 34px; gap: 8px; align-items: center; font-size: 12px; }
.hbar-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); text-align: right; }
.hbar-track { display: block; height: 10px; background: var(--line-soft); border-radius: 5px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--series-1); border-radius: 0 5px 5px 0; }
.hbar-val { font-weight: 600; }
.tag-bars { display: grid; gap: 12px; padding: 0 20px 18px; }
.tag-bar { display: grid; gap: 4px; }
.stat-grid.three { grid-template-columns: repeat(3, 1fr); margin: 12px 0; }
.crit-list { display: grid; max-height: 360px; overflow-y: auto; }
.crit { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--line-soft); text-decoration: none; color: inherit; }
.crit:hover { background: #fafbfd; }
.crit > span:nth-child(2) { flex: 1; min-width: 0; }
.crit-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--red-soft); }
.crit-icon.task { background: var(--amber-soft); }

/* hesabım */
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.acc-body { display: grid; gap: 14px; max-width: 900px; }
.acc-card { padding: 18px 20px; display: grid; gap: 10px; }
.acc-card h3 { font-size: 15px; }
.avatar-edit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.drop { flex: 1; min-width: 220px; border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; cursor: pointer; color: var(--text); }
.drop.on, .drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.notify-table td { vertical-align: top; }
.notify-table tr.grp td { background: #fafbfd; font-weight: 700; font-size: 13px; }
.notify-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--green); }

@media (max-width: 1100px) { .dash-grid, .chart-row { grid-template-columns: 1fr; } }
.segmented button { white-space: nowrap; }

/* yetkiler */
.no-perm { display: none !important; }
.perm-box { display: grid; gap: 10px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.perm-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); cursor: pointer; }
.perm-item input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); }
.perm-item:has(input:disabled) { opacity: .5; cursor: default; }
code { background: var(--line-soft); padding: 1px 5px; border-radius: 5px; font-size: 12px; word-break: break-all; }
@media (max-width: 860px) { .perm-grid { grid-template-columns: 1fr; } }

/* ---------- yapay zekâ asistanı ---------- */
.ag-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.ag-grid > * { min-width: 0; }
.ag-card { padding: 18px 20px; display: grid; gap: 10px; align-content: start; }
.ag-card h3 { margin: 6px 0 0; font-size: 15px; }
.ag-card h3:first-child { margin-top: 0; }
.check-line { display: flex; gap: 8px; align-items: flex-start; color: var(--text); font-size: 14px; cursor: pointer; }
.check-line input { margin-top: 3px; }
.day-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.day-pick label { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; color: var(--text); cursor: pointer; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kb-list { display: grid; gap: 10px; }
.kb-item { padding: 12px 16px; display: grid; gap: 6px; }
.kb-item.dim { opacity: .75; }
.kb-top, .kb-foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kb-top strong { min-width: 0; overflow-wrap: anywhere; }
.kb-text { white-space: pre-wrap; color: var(--muted); overflow-wrap: anywhere; }
.try-box { background: var(--chat-bg); border-radius: 10px; min-height: 280px; max-height: 52vh; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.try-box .msg { max-width: 85%; }
.try-box .msg.customer { align-self: flex-start; }
.try-box .msg.me { align-self: flex-end; }
.try-meta { font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 4px; }
.ag-tips { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.msg.bot { background: var(--violet-soft); }
.msg.bot .who { color: var(--violet); }
.msg.note.bot { background: var(--note); }
.chip-btn { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
@media (max-width: 900px) {
  .ag-grid, .form-grid.three { grid-template-columns: minmax(0, 1fr); }
}
.page-asistan .segmented { max-width: 100%; overflow-x: auto; }

/* Bölümler ve WhatsApp numaraları */
.dept-chip { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--blue-soft); color: var(--primary-text); white-space: nowrap; }
.dept-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.dept-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.dept-row > div { min-width: 0; overflow-wrap: anywhere; }
.dept-row > .row { flex: none; }
@media (max-width: 640px) { .dept-row { flex-direction: column; align-items: stretch; } }
.perm-depts .row { flex-wrap: wrap; gap: 6px 16px; }
.sofis-chip { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--green-soft); color: var(--green); white-space: nowrap; }
.cp-item.doc-missing { opacity: .55; cursor: default; }
.inst-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.inst-kpi strong { font-size: 18px; display: block; margin-top: 2px; }
.inst-kpi.bad strong { color: var(--red); }
.doc-count { font-size: 11px; color: var(--muted, #6b7486); white-space: nowrap; }
.loose-docs { margin-top: 14px; } .loose-docs summary { cursor: pointer; color: var(--muted, #6b7486); }
.cari-filter { align-items: flex-end; } .cari-table td { vertical-align: top; } .cari-table td:nth-child(3) { min-width: 240px; }
/* Poliçe türü renkleri: araç mavi, konut/işyeri turuncu, sağlık/kişi yeşil, nakliyat mor, sorumluluk camgöbeği */
.pt-auto { --pt: #2a78d6; --pt-soft: #e7f0fb; } .pt-home { --pt: #d9822b; --pt-soft: #fcefe0; } .pt-health { --pt: #1f9d6b; --pt-soft: #e2f5ec; }
.pt-cargo { --pt: #8a5cd1; --pt-soft: #f0e9fb; } .pt-liab { --pt: #138a9e; --pt-soft: #e0f3f6; } .pt-other { --pt: #7a8394; --pt-soft: #eef0f3; }
.pt-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--pt-soft); font-size: 14px; flex: none; vertical-align: middle; }
.cp-item.pol-item { border-left: 4px solid var(--pt); }
.cp-item.pol-item.pol-closed { opacity: .7; }
.pt-cell { border-left: 3px solid var(--pt); }
.doc-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #eef0f3; color: var(--muted); white-space: nowrap; text-decoration: none; vertical-align: middle; }
.doc-badge.pdf { background: #fde8e8; color: #c0392b; } .doc-badge.pdf:hover { background: #f9d2d2; } .doc-badge span { font-weight: 500; opacity: .8; }
.spol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.spol-grid .spol-q { grid-column: span 2; }
.spol-pager { align-items: center; gap: 6px; margin-bottom: 8px; } .spol-pager .input.sm { width: auto; padding: 3px 6px; }
.spol-table th.sortable { cursor: pointer; user-select: none; } .spol-table th.sorted { color: var(--primary-text, #1b4fa0); }
.spol-table tr.spol-closed td { color: var(--muted); }
.doc-name { white-space: normal; overflow-wrap: anywhere; font-weight: 600; }
