/* Satış fırsatları kanban panosu (deals.js). Aşama renkleri tags.css'teki tag-* sınıflarını kullanır. */
.deal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.deal-toolbar .search-box { flex: 1 1 260px; max-width: 420px; height: 36px; background: #fff; }
.deal-toolbar select { height: 36px; padding: 0 10px; border: 1px solid #e6e8f0; border-radius: 8px; outline: 0; color: #5e6277;
  background: #fff; font-size: 12px; }
.deal-toolbar select:focus { border-color: #988ef0; }
.deal-summary { display: flex; flex-wrap: wrap; gap: 14px; margin-left: auto; color: #6f7387; font-size: 12px; }
.deal-summary b { color: #303449; }
.deal-summary-won b { color: #1d7a45; }

.deal-board { display: flex; align-items: flex-start; gap: 14px; min-height: 60vh; padding-bottom: 14px; overflow-x: auto; }
.deal-board > .empty-state { flex: 1; }
.deal-column { display: flex; flex: 0 0 272px; flex-direction: column; max-height: calc(100vh - 250px); border: 1px solid var(--line);
  border-radius: 11px; background: #f1f2f7; }
.deal-column-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 2px; color: #303449; font-size: 12.5px; }
.deal-column-head b { overflow: hidden; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.deal-count { padding: 1px 7px; border-radius: 999px; color: #6c6f80; background: #e3e5ee; font-size: 10.5px; font-weight: 700; }
.deal-add { margin-left: auto; padding: 1px 7px; border: 0; border-radius: 6px; color: #8a8da0; background: transparent; font-size: 15px; line-height: 1.2; }
.deal-add:hover { color: var(--purple); background: #e8e5ff; }
.deal-column-total { padding: 2px 12px 9px 28px; color: #85899d; font-size: 11px; font-weight: 600; }
.deal-column.kind-won .deal-column-total { color: #1d7a45; }
.deal-column.kind-lost .deal-column-total { color: #a85361; }
.deal-dot { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }

.deal-list { display: flex; flex: 1; flex-direction: column; gap: 8px; min-height: 90px; padding: 2px 8px 10px; overflow-y: auto;
  border-radius: 0 0 11px 11px; transition: background .12s; }
.deal-list.drop-over { background: #e9e6ff80; }
.deal-empty { padding: 16px 8px; border: 1px dashed #d9dbe5; border-radius: 9px; color: #a7a9b6; font-size: 11px; text-align: center; }
.deal-list.drop-over .deal-empty { display: none; }
.deal-more { flex: none; padding: 8px; border: 1px dashed #d4d0f5; border-radius: 9px; color: #5b4fd6; background: #fff; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.deal-more:hover { background: #f6f4ff; }
.deal-more small { color: #9a9db0; font-weight: 400; }
.deal-placeholder { flex: 0 0 auto; min-height: 44px; border: 2px dashed #b6aef5; border-radius: 9px; background: #f6f5ff; }

.deal-card { padding: 10px 11px; border: 1px solid #e6e8f0; border-radius: 9px; background: #fff; box-shadow: 0 1px 3px #282c420a;
  cursor: grab; transition: border-color .12s, box-shadow .12s; }
.deal-card:hover { border-color: #c8c3f6; box-shadow: 0 3px 10px #282c4214; }
.deal-card:focus-visible { outline: 2px solid #988ef0; outline-offset: 1px; }
.deal-card.dragging { opacity: .35; }
.deal-card:active { cursor: grabbing; }
.deal-card-title { color: #282c42; font-size: 12.5px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.deal-card-sub { margin-top: 3px; overflow: hidden; color: #85899d; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.deal-card-links { display: grid; gap: 2px; margin-top: 4px; min-width: 0; }
.deal-link { overflow: hidden; max-width: 100%; justify-self: start; color: #5b5f75; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; text-decoration: none; }
.deal-link:hover, .deal-link:focus-visible { color: #5b4fd6; text-decoration: underline; }
.deal-card-foot { display: flex; align-items: center; gap: 8px; min-height: 22px; margin-top: 8px; }
.deal-card-amount { margin-right: auto; color: #303449; font-size: 12px; font-weight: 700; }
.deal-card-date { color: #85899d; font-size: 10.5px; white-space: nowrap; }
.deal-card-date.overdue { color: #b3303e; font-weight: 600; }
.deal-owner { display: grid; flex: 0 0 22px; place-items: center; width: 22px; height: 22px; overflow: hidden; border-radius: 50%;
  color: #6253d1; background: #e9e6ff; font-size: 10px; font-weight: 700; }
.deal-owner img { width: 100%; height: 100%; object-fit: cover; }
.kind-won .deal-card { border-left: 3px solid #4bb37c; }
.kind-lost .deal-card { border-left: 3px solid #d07a86; opacity: .85; }

/* Fırsat penceresi */
.deal-dialog { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; }
.deal-dialog textarea { width: 100%; padding: 9px 10px; border: 1px solid #e7e8ef; border-radius: 7px; outline: 0; color: #44485e;
  font: inherit; font-size: 12px; resize: vertical; }
.deal-dialog textarea:focus { border-color: #988ef0; box-shadow: 0 0 0 3px #7162df14; }
.deal-amount { display: grid; grid-template-columns: 1fr 84px; gap: 6px; }
.deal-dialog .dialog-actions { align-items: center; }
.deal-dialog .deal-delete { margin-right: auto; font-size: 12px; }
.deal-dialog .form-error:empty { display: none; }
#dealMeta:empty { display: none; }
#dealMeta { margin-top: 12px; font-size: 11px; }

/* Aşamalar penceresi */
.deal-stages-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; }
.stage-new-row { display: grid; grid-template-columns: 1fr 140px auto; gap: 8px; margin: 12px 0 14px; }
.stage-list { border-top: 1px solid #eef0f5; }
.stage-row { display: grid; grid-template-columns: auto 10px 1fr 110px 120px 72px auto; gap: 8px; align-items: center; padding: 7px 0;
  border-bottom: 1px solid #f1f2f6; font-size: 12px; }
.dialog .stage-row input, .dialog .stage-row select { height: 32px; }
.stage-order { display: flex; }
.stage-order .icon-button { padding: 2px 5px; font-size: 13px; }
.stage-order .icon-button:disabled { opacity: .3; cursor: default; }
.stage-count { color: #85899d; font-size: 11px; white-space: nowrap; }
.stage-delete-confirm { display: flex; flex-wrap: wrap; grid-column: 1 / -1; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 8px; color: #8a3340; background: #fdf0f2; font-size: 12px; }
.dialog .stage-delete-confirm select { width: auto; min-width: 140px; }

/* Odoo'dan aktar penceresi */
.checkbox-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; color: #303449; font-size: 12.5px; cursor: pointer; }
.dialog .checkbox-row input { width: auto; height: auto; margin: 0; }
.odoo-deals-result:empty { display: none; }
.odoo-deals-result { margin-top: 14px; padding: 12px; border: 1px solid #eceef4; border-radius: 10px; background: #fafbfd; font-size: 12px; }
.odoo-deals-result h3 { margin: 0 0 8px; color: #282c42; font-size: 13px; }
.odoo-deals-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.odoo-deals-stats div { padding: 8px 10px; border: 1px solid #e6e8f0; border-radius: 8px; background: #fff; }
.odoo-deals-stats b { display: block; color: #282c42; font-size: 16px; }
.odoo-deals-stats span { color: #85899d; font-size: 11px; }
.odoo-deals-stages { display: flex; flex-wrap: wrap; gap: 6px; }
.odoo-deals-stage { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid #e6e8f0; border-radius: 999px; background: #fff; }
.odoo-deals-stage small { color: #85899d; }
.odoo-deals-stage.is-new { border-color: #b9e3c9; background: #f1fbf5; }
.odoo-deals-stage.is-local { border-style: dashed; }
.odoo-deals-warn { margin: 10px 0 0; color: #8a5a00; }

/* Kişi kartı ve firma penceresindeki "Fırsatlar" bölümü */
.record-deals:empty { display: none; }
.record-deals { margin: 16px 0 4px; padding: 12px; border: 1px solid #eceef4; border-radius: 10px; background: #fafbfd; }
.record-deals-head { display: flex; align-items: center; gap: 8px; color: #303449; font-size: 12.5px; }
.record-deals-head .button { margin-left: auto; }
.record-deals-total { color: #6f7387; font-size: 11.5px; font-weight: 600; }
.record-deals-list { display: grid; gap: 6px; max-height: 220px; margin-top: 10px; overflow-y: auto; }
.record-deals-empty { margin-top: 8px; color: #a0a3b2; font-size: 11.5px; }
.record-deal { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 1px solid #e6e8f0; border-radius: 8px;
  color: inherit; background: #fff; text-align: left; }
.record-deal:hover { border-color: #c8c3f6; background: #fbfaff; }
.record-deal-text { display: grid; flex: 1; min-width: 0; }
.record-deal-title { overflow: hidden; color: #282c42; font-size: 12px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.record-deal-text small { overflow: hidden; color: #85899d; font-size: 10.5px; white-space: nowrap; text-overflow: ellipsis; }
.record-deal-amount { color: #303449; font-size: 12px; font-weight: 700; white-space: nowrap; }
.record-deal.kind-won .record-deal-amount { color: #1d7a45; }
.record-deal.kind-lost { opacity: .7; }

@media (max-width: 760px) {
  .deal-column { flex-basis: 240px; max-height: none; }
  .deal-summary { margin-left: 0; }
  .stage-row { grid-template-columns: auto 10px 1fr 1fr; }
  .stage-new-row { grid-template-columns: 1fr; }
}
