/* Fırsat aktiviteleri (deal-activities.js): kart ikonu, açılır liste, fırsat penceresi → Aktiviteler, Aktiviteler penceresi ve rapor. */

/* Kart ikonu: yeşil planlı, turuncu bugün, kırmızı gecikmiş, gri sonraki adım yok. */
.deal-act { display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 6px; border: 1px solid transparent; border-radius: 999px;
  font-size: 11.5px; line-height: 1; cursor: pointer; }
.deal-act small { font-size: 9.5px; font-weight: 700; }
.deal-act.is-planned { color: #2f7d52; background: #e8f6ee; }
.deal-act.is-today { color: #9a5b00; background: #fff1d6; }
.deal-act.is-overdue { color: #b3303e; background: #fde8eb; font-weight: 700; }
.deal-act.is-none { color: #a3a6b5; background: transparent; border-color: #e1e3ea; border-style: dashed; }
.deal-act:hover { border-color: #b7b0f3; }
.deal-act:focus-visible { outline: 2px solid #988ef0; outline-offset: 1px; }
.deal-summary-act { color: #6f7387; text-decoration: none; border-bottom: 1px dashed #c6c8d3; }
.deal-summary-act:hover { color: #5b4fd6; border-color: #5b4fd6; }
.deal-summary-act.is-overdue { color: #b3303e; font-weight: 600; border-color: #e7a1aa; }

/* Açılır liste */
.deal-act-pop { position: fixed; z-index: 40; width: 340px; max-width: calc(100vw - 16px); max-height: min(460px, calc(100vh - 16px)); display: flex;
  flex-direction: column; border: 1px solid #dfe1ea; border-radius: 11px; background: #fff; box-shadow: 0 12px 32px #282c4229; font-size: 12px; }
.dap-head { display: flex; align-items: center; gap: 8px; padding: 9px 10px 6px 12px; border-bottom: 1px solid #f0f1f5; }
.dap-head b { flex: 1; overflow: hidden; color: #282c42; font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
.dap-body { flex: 1; overflow-y: auto; padding: 6px 8px; }
.dap-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid #f0f1f5; }
.dap-empty { padding: 14px 8px; color: #8a8da0; text-align: center; }
.dap-empty.error { color: #b3303e; }

/* Satırlar */
.da-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.da-list.compact { gap: 4px; }
.da-item { display: flex; gap: 10px; padding: 9px 10px; border: 1px solid #e8e9f0; border-radius: 9px; background: #fff; }
.da-list.compact .da-item { padding: 7px 6px; border-color: transparent; }
.da-list.compact .da-item + .da-item { border-top-color: #f0f1f5; border-radius: 0; }
.da-item.state-overdue { border-left: 3px solid #d9646f; }
.da-item.state-today { border-left: 3px solid #e3a93b; }
.da-item.state-planned { border-left: 3px solid #4bb37c; }
.da-item.is-done { background: #fafbfd; }
.da-item.editing { display: block; padding: 0; border: 0; background: transparent; }
.da-icon { display: grid; flex: 0 0 26px; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #4b3fc4; background: #eeebff; font-size: 13px; }
.da-icon.state-overdue { color: #b3303e; background: #fde8eb; }
.da-icon.state-today { color: #9a5b00; background: #fff1d6; }
.da-item.is-done .da-icon { color: #2f7d52; background: #e8f6ee; }
.da-main { flex: 1; min-width: 0; }
.da-line { display: flex; align-items: baseline; gap: 8px; }
.da-title { flex: 1; min-width: 0; color: #282c42; font-weight: 600; overflow-wrap: anywhere; }
.da-due { flex: none; color: #6f7387; font-size: 11px; white-space: nowrap; }
.da-due.state-overdue { color: #b3303e; font-weight: 700; }
.da-due.state-today { color: #9a5b00; font-weight: 700; }
.da-due.state-planned { color: #2f7d52; }
.da-due.is-done { color: #2f7d52; }
.da-meta { margin-top: 2px; color: #85899d; font-size: 11px; overflow-wrap: anywhere; }
.da-cal { color: #5b4fd6; text-decoration: none; }
.da-note { margin-top: 5px; padding: 6px 8px; border-radius: 7px; color: #44485e; background: #f6f7fa; font-size: 11.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.da-note.result { background: #eef8f2; }
.da-deal { display: block; max-width: 100%; margin-top: 2px; padding: 0; overflow: hidden; border: 0; color: #5b5f75; background: none; font-size: 11.5px;
  text-align: left; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.da-deal:hover { color: #5b4fd6; text-decoration: underline; }
.da-evidence { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; padding: 5px 8px; border: 1px dashed #9fd7b6;
  border-radius: 7px; color: #22663f; background: #f1fbf5; font-size: 11.5px; }
.da-evidence span { flex: 1; min-width: 160px; }
.da-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; }
.da-actions .text-button { padding: 0; font-size: 11.5px; }
.da-snooze { height: 26px; padding: 0 6px; border: 1px solid #e6e8f0; border-radius: 7px; color: #5e6277; background: #fff; font-size: 11.5px; }
.dialog .da-snooze { width: auto; height: 26px; }
.da-done-form { margin-top: 6px; }
.da-done-form textarea, .da-form textarea { width: 100%; padding: 7px 9px; border: 1px solid #e7e8ef; border-radius: 7px; outline: 0; color: #44485e;
  font: inherit; font-size: 12px; resize: vertical; }
.da-done-form textarea:focus, .da-form textarea:focus { border-color: #988ef0; }
.da-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }

/* Fırsat penceresi → Aktiviteler */
.da-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; color: #303449; font-size: 12.5px; }
.da-spacer { flex: 1; }
.da-empty { margin: 4px 0 10px; padding: 12px; border: 1px dashed #e3c6a0; border-radius: 9px; color: #8a5a00; background: #fffaf1; font-size: 12px; }
.da-done-list { margin-top: 14px; }
.da-done-list > summary { margin-bottom: 8px; color: #5e6277; font-size: 12px; font-weight: 600; cursor: pointer; }
.da-form { margin-bottom: 12px; padding: 12px; border: 1px solid #d9d4fb; border-radius: 10px; background: #fbfaff; }
.da-form-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; color: #282c42; font-size: 12.5px; }
.da-label { display: block; margin-bottom: 4px; }
.da-types { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.da-type { padding: 5px 10px; border: 1px solid #e1e3ea; border-radius: 999px; color: #4a5066; background: #fff; font-size: 12px; cursor: pointer; }
.da-type:hover { border-color: #b7b0f3; }
.da-type.active { border-color: #7162df; color: #fff; background: #7162df; }
.da-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.da-chip { padding: 2px 7px; border: 1px solid #e6e8f0; border-radius: 999px; color: #5e6277; background: #fff; font-size: 10.5px; cursor: pointer; }
.da-chip:hover { border-color: #988ef0; color: #5b4fd6; }
.da-cal-box { margin-top: 10px; padding: 8px 10px; border: 1px solid #eceef4; border-radius: 8px; background: #fff; }
.da-cal-box .checkbox-row { margin: 4px 0; font-size: 12px; }
.da-cal-more { margin-left: 22px; }
.da-inline { display: inline-flex; align-items: center; gap: 6px; color: #5e6277; font-size: 12px; }
.dialog .da-inline select, .dialog .da-inline input { width: auto; height: 30px; }
.da-form .form-error:empty { display: none; }

/* Fırsata bağlı olmayan aktivite (görev) penceresi (#taskDialog) */
.da-deal.is-task { color: #85899d; cursor: default; }
.da-deal.is-task:hover { color: #85899d; text-decoration: none; }
.task-dialog { width: min(640px, calc(100vw - 32px)); }
.task-dialog .contact-form-grid small.muted { display: block; margin-top: 3px; font-size: 11px; }
.task-dialog textarea { width: 100%; padding: 7px 9px; border: 1px solid #e7e8ef; border-radius: 7px; outline: 0; color: #44485e; font: inherit;
  font-size: 12.5px; resize: vertical; }
.task-dialog textarea:focus { border-color: #988ef0; }
.task-dialog .form-error:empty { display: none; }

/* AI önerileri */
.da-suggest { margin-bottom: 12px; padding: 10px 12px; border: 1px solid #d9d4fb; border-radius: 10px; background: #f8f6ff; font-size: 12px; }
.da-suggest.error { border-color: #f1c4ca; color: #8a3340; background: #fdf0f2; }
.da-suggest-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.da-suggest-head .icon-button { margin-left: auto; }
.da-suggest-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid #ebe8fb; }

/* Satış → Aktiviteler sayfası (#activities) */
.da-tabs { margin: 4px 0 12px; }
.da-toolbar select { width: auto; }
/* Özel tarih aralığı: iki tarih (datefmt.js gg.aa.yyyy alanı + takvim düğmesi) tek kutuda, filtre seçimleriyle aynı yükseklikte. */
.da-date-range { grid-column: span 2; display: flex; align-items: center; gap: 2px; min-width: 0; height: 36px; padding: 0 3px 0 4px; border: 1px solid #e9eaf1; border-radius: 7px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.da-date-range:hover { border-color: #d6d4f5; }
.da-date-range:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(104,87,223,.14); }
.da-date-range .date-field-wrap { flex: 1 1 0; }
.da-date-range input.date-field { width: 100%; height: 30px; padding: 0 30px 0 8px; border: 0; border-radius: 5px; outline: 0; color: #3d4152; background: transparent; font-size: 12px; font-weight: 600; }
.da-date-range input.date-field:focus { background: #f6f5fe; }
.da-date-range input.date-field.bad { color: #b3303e; background: #fdf0f2; }
.da-date-sep { flex: none; color: #a0a2b0; font-size: 12px; }
@media (max-width: 520px) { .da-date-range { grid-column: auto; } }
.da-list-body { min-height: 120px; }
.da-page-body { padding: 4px 24px 22px; }
@media (max-width: 760px) { .da-page-body { padding: 4px 14px 16px; } }
.da-group { display: flex; align-items: center; gap: 6px; margin: 14px 0 8px; color: #303449; font-size: 12.5px; }
.da-group:first-child { margin-top: 0; }
.da-group.state-overdue { color: #b3303e; }
.da-group.state-today { color: #9a5b00; }
/* Aktiviteler sayfası tablo görünümü */
.da-page-body:has(.da-table) { padding: 0 0 8px; }
.da-table td { vertical-align: top; color: #44485e; font-size: 12px; white-space: normal; }
.da-table td.da-col-icon, .da-table th.da-col-icon { width: 1%; padding-right: 0; }
.da-table .da-icon { width: 24px; height: 24px; font-size: 12px; }
.da-table .da-col-main { min-width: 220px; max-width: 420px; }
.da-table .da-col-deal { min-width: 160px; max-width: 260px; }
.da-table .da-title { display: block; font-weight: 600; }
.da-table .da-deal { margin-top: 0; font-size: 12px; }
.da-sub { margin-top: 2px; color: #85899d; font-size: 11px; overflow-wrap: anywhere; }
.da-note-line { max-width: 420px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.da-table .da-due { font-size: 12px; }
.da-table .da-evidence { margin-top: 4px; padding: 3px 6px; font-size: 11px; }
.da-row-actions { display: flex; align-items: center; gap: 4px 10px; white-space: nowrap; }
.da-row-actions .text-button { padding: 0; font-size: 11.5px; }
.da-table tr.da-row.state-overdue td:first-child { box-shadow: inset 3px 0 #d9646f; }
.da-table tr.da-row.state-today td:first-child { box-shadow: inset 3px 0 #e3a93b; }
.da-table tr.da-row.state-planned td:first-child { box-shadow: inset 3px 0 #4bb37c; }
.da-table tr.da-row.is-done { background: #fafbfd; }
.da-table tr.da-row.is-done .da-icon { color: #2f7d52; background: #e8f6ee; }
.da-table tr.da-row:hover { background: #f8f8fc; }
.da-table tr.da-form-row td { padding-top: 0; border-top: 0; }
.da-table tr.da-row:has(+ .da-form-row) td { border-bottom: 0; }
.da-table tr.da-group-row td { padding: 9px 17px 7px; color: #303449; background: #f7f8fb; font-size: 12px; font-weight: 700; }
.da-table tr.da-group-row.state-overdue td { color: #b3303e; }
.da-table tr.da-group-row.state-today td { color: #9a5b00; }
.da-report-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.da-report-stats div { padding: 9px 11px; border: 1px solid #e6e8f0; border-radius: 9px; background: #fafbfd; }
.da-report-stats b { display: block; color: #282c42; font-size: 17px; }
.da-report-stats span { color: #85899d; font-size: 11px; }
.da-report-stats .is-overdue b, .da-report td.is-overdue { color: #b3303e; font-weight: 700; }
.da-report { width: 100%; font-size: 12px; }
.da-report th { white-space: nowrap; }
.da-user { display: inline-flex; align-items: center; gap: 7px; }
.da-type-count { display: inline-block; margin-right: 8px; white-space: nowrap; }
.da-count-link { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.da-count-link:hover { color: var(--purple, #5b4bd5); text-decoration-style: solid; }

/* Fırsat penceresi sekme sayısı ve sağlık şeridindeki sonraki adım */
#dealActivityCount.is-overdue { color: #fff; background: #d9646f; }
.dh-next { padding: 0; font-size: 12px; }
.dh-next.is-late { color: #b3303e; font-weight: 600; }
.dh-next.is-none { color: #9a6400; }

/* Bildirim zili (notifications.js): zamanı gelen aktivite */
.notif-icon.activity { color: #4b3fc4; background: #eeebff; }

/* Bugün (briefing.js): aktivite işi */
.br-kind.activity { color: #4b3fc4; background: #eeebff; }
.br-stat.activity b { color: #4b3fc4; }

@media (max-width: 760px) {
  .da-line { flex-wrap: wrap; }
  .deal-act-pop { width: calc(100vw - 16px); }
}
