/* Fırsat penceresi → Geçmiş ve Kişiler sekmeleri (deal-history.js). Sekme çubuğu messages.css'teki .cd-tabs / .cd-tab. */
.deal-dialog.wide { width: min(900px, 100%); }
.deal-dialog .cd-tabs { margin-top: 0; }
.deal-pane.hidden { display: none; }

/* Bilgiler sekmesindeki özet şerit */
.deal-health-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 14px; padding: 8px 12px; border: 1px solid #eceef4;
  border-radius: 10px; color: #55596e; background: #fafbfd; font-size: 12px; }
.deal-health-strip.hidden { display: none; }
.deal-health-strip .text-button { margin-left: auto; font-size: 12px; }
.dh-sep { color: #c3c5d0; }
.dh-warn { color: #b3303e; font-weight: 600; }

.dh-score { display: inline-flex; align-items: baseline; padding: 2px 8px; border-radius: 999px; color: #fff; background: #8a8da0; font-size: 13px; font-weight: 800; }
.dh-score small { margin-left: 1px; font-size: 9.5px; font-weight: 600; opacity: .85; }
.dh-score.is-good { background: #2f9a5f; }
.dh-score.is-watch { background: #d8961f; }
.dh-score.is-risk { background: #cf4b59; }
.dh-level.is-good { color: #2f7d52; }
.dh-level.is-watch { color: #9a6400; }
.dh-level.is-risk { color: #b3303e; }

.dh-empty { padding: 26px 10px; color: #a0a3b2; font-size: 12.5px; text-align: center; }
.dh-empty.small { padding: 10px; text-align: left; }
.dh-empty.error, .dh-body.error { color: #b3303e; }
.dh-note { margin: 6px 0 0; color: #8a8da0; font-size: 11px; }
.dh-hint { margin: 0 0 10px; padding: 8px 11px; border-radius: 8px; color: #7a5600; background: #fff7e6; font-size: 12px; }

/* Geçmiş: üst bölüm */
.dh-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.dh-stats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 360px; }
.dh-chip { padding: 3px 9px; border: 1px solid #e6e8f0; border-radius: 999px; color: #5e6277; background: #fff; font-size: 11px; white-space: nowrap; }
.dh-chip b { color: #282c42; }
.dh-chip.muted { color: #a0a3b2; }
.dh-health { border: 1px solid #eceef4; border-radius: 10px; background: #fafbfd; font-size: 12px; }
.dh-health.closed { padding: 10px 12px; color: #6f7387; }
.dh-health summary { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; list-style: none; }
.dh-health summary::-webkit-details-marker { display: none; }
.dh-health summary > span:nth-child(2) { display: grid; }
.dh-health summary small { color: #85899d; font-size: 11px; }
.dh-more { margin-left: auto; color: #5b4fd6; font-size: 11px; }
.dh-health[open] .dh-more { color: #8a8da0; }
.dh-health ul { display: grid; gap: 3px; margin: 0; padding: 0 12px 4px; list-style: none; }
.dh-health li { display: flex; gap: 8px; color: #44485e; font-size: 11.5px; }
.dh-health li span { flex: 0 0 30px; color: #8a8da0; font-weight: 700; text-align: right; }
.dh-health li.plus span { color: #2f7d52; }
.dh-health li.minus span { color: #b3303e; }
.dh-health .dh-note { padding: 0 12px 10px; }

/* Yapay zeka özeti */
.dh-ai { margin-top: 12px; padding: 11px 13px; border: 1px solid #e4e0ff; border-radius: 10px; background: linear-gradient(180deg, #faf9ff, #fff); }
.dh-ai-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #3b2fb0; font-size: 12.5px; }
.dh-ai-head small { color: #8a8da0; font-size: 10.5px; }
.dh-ai-head .button { margin-left: auto; }
.dh-ai-summary { margin: 8px 0 0; color: #303449; font-size: 12.5px; line-height: 1.5; }
.dh-ai-chance { margin: 6px 0 0; color: #44485e; font-size: 11.5px; }
.dh-ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 4px 16px; margin-top: 6px; }
.dh-ai-sec h4 { margin: 8px 0 3px; color: #5e6277; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; }
.dh-ai-sec ul { margin: 0; padding-left: 16px; color: #303449; font-size: 12px; line-height: 1.45; }
.dh-ai-sec.warn h4 { color: #a0434f; }
.dh-ai-sec.next h4 { color: #2f7d52; }

/* Araç çubuğu */
.dh-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 8px; }
.dh-toolbar .mode-toggle button small { margin-left: 3px; opacity: .7; }
.dh-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.dh-filter { padding: 4px 9px; border: 1px solid #e6e8f0; border-radius: 999px; color: #5e6277; background: #fff; font-size: 11.5px; cursor: pointer; }
.dh-filter:hover { border-color: #c8c3f6; }
.dh-filter.active { border-color: #7162df; color: #fff; background: #7162df; }
.dialog .dh-contact-filter { width: auto; max-width: 220px; height: 30px; margin-left: auto; font-size: 12px; }

.dh-fetch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; padding: 7px 11px; border-radius: 8px;
  color: #4b4f66; background: #f3f4f9; font-size: 11.5px; }
.dh-fetch .button { margin-left: auto; }

/* Zaman akışı */
.dh-list { margin: 0; padding: 0; list-style: none; }
.dh-month { margin: 12px 0 4px; color: #8a8da0; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.dh-month:first-child { margin-top: 0; }
.dh-item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 8px 6px; border-bottom: 1px solid #f1f2f6; }
.dh-item.is-company { opacity: .72; }
.dh-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: #5b4fd6; background: #efedff; font-size: 13px; }
.dh-item.kind-meeting .dh-icon { color: #1e6fa8; background: #e7f2fb; }
.dh-item.kind-message .dh-icon { color: #23845a; background: #e6f6ee; }
.dh-item.kind-call .dh-icon { color: #9a6400; background: #fff4de; }
.dh-item.kind-document .dh-icon { color: #8b3fa8; background: #f6eafb; }
.dh-item.kind-stage .dh-icon { color: #6c6f80; background: #eef0f5; }
.dh-item.kind-campaign .dh-icon { color: #8a8da0; background: #f1f2f6; }
.dh-item.dir-inbound .dh-icon { box-shadow: inset 3px 0 0 #2f9a5f; }
.dh-line { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.dh-title { overflow: hidden; color: #282c42; font-size: 12.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.dh-line time { flex: none; margin-left: auto; color: #8a8da0; font-size: 11px; }
.dh-meta { margin-top: 1px; color: #6f7387; font-size: 11.5px; }
.dh-preview { display: -webkit-box; margin-top: 3px; overflow: hidden; color: #55596e; font-size: 11.5px; line-height: 1.45;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* Teams katılım raporu (toplantı satırı) */
.dh-attendance { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 5px; margin-top: 4px; font-size: 11px; }
.dh-att-label { color: #8a8da0; font-weight: 600; }
.dh-att-label:not(:first-child) { margin-left: 6px; }
.dh-att { padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.dh-att a { color: inherit; text-decoration: none; }
.dh-att a:hover { text-decoration: underline; }
.dh-att small { opacity: .75; }
.dh-att.yes { color: #1f7a48; background: #e6f5ec; }
.dh-att.yes.team { color: #5e6277; background: #eef0f5; }
.dh-att.no { color: #b3412f; background: #fdecea; }
.dh-actions { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 3px; }
.dh-actions .text-button { padding: 0; font-size: 11px; text-decoration: none; }
.dh-badge { flex: none; padding: 0 6px; border-radius: 999px; color: #5e6277; background: #eef0f5; font-size: 10px; font-weight: 600; }
.dh-badge.pin { color: #4b3fc4; background: #eeebff; }
.dh-badge.off { color: #8a8da0; background: #f3f4f7; font-weight: 500; }
.dh-badge.next { color: #1e6fa8; background: #e7f2fb; }
.dh-body { margin-top: 6px; padding: 8px 10px; border: 1px solid #eceef4; border-radius: 8px; background: #fafbfd; font-size: 11.5px; }
.dh-body.muted { color: #a0a3b2; }
.dh-body-head { margin-bottom: 6px; color: #6f7387; }
.dh-body pre { max-height: 320px; margin: 0; overflow: auto; color: #303449; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.dh-more-btn { width: 100%; margin-top: 10px; }

/* Kişiler sekmesi */
.dh-add-contact { display: grid; grid-template-columns: 1fr 160px auto; gap: 8px; margin-bottom: 6px; }
.dialog .dh-add-contact input, .dialog .dh-add-contact select { height: 34px; }
.dh-h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 16px 0 6px; color: #303449; font-size: 13px; }
.dh-h3 small { color: #8a8da0; font-weight: 600; }
.dh-missing { margin-left: auto; color: #9a6400; font-size: 11px; font-weight: 500; }
.dh-people { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.dh-person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #e6e8f0; border-radius: 9px; background: #fff; }
.dh-person.linked { border-color: #d9d4fb; background: #fcfbff; }
.dh-person.inactive { opacity: .6; }
.dh-person-main { display: grid; flex: 1; min-width: 0; }
.dh-person-name { display: flex; align-items: center; gap: 6px; overflow: hidden; color: #282c42; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.dh-person-main small { overflow: hidden; color: #6f7387; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.dh-person-main small.muted { color: #9a9db0; }
.dh-open { color: #8a8da0; font-weight: 400; text-decoration: none; }
.dh-open:hover { color: #5b4fd6; }
.dh-person-actions { display: flex; align-items: center; gap: 8px; }
.dialog .dh-role { width: 150px; height: 30px; font-size: 12px; }

@media (max-width: 760px) {
  .dh-top { grid-template-columns: 1fr; }
  .dh-stats { justify-content: flex-start; max-width: none; }
  .dh-add-contact { grid-template-columns: 1fr; }
  .dh-person { flex-wrap: wrap; }
}

/* Bilgiler sekmesindeki yapay zeka özeti (#dealInsightBox). */
#dealInsightBox .dh-ai { margin: 0 0 12px; }
.dh-ai.is-stale .dh-ai-summary, .dh-ai.is-stale .dh-ai-grid, .dh-ai.is-stale .dh-ai-chance { opacity: .6; }
.dh-ai-badge { padding: 1px 7px; border-radius: 999px; background: #efeaff; color: #4a36c4; font-size: 11px; font-weight: 700; }
.dh-ai-foot { margin: 8px 0 0; color: #8a8da0; font-size: 10.5px; }
.dh-ai .dh-note.error { color: #8e2a20; }