/* DentCell — Mesajlar (tek kanal gelen kutusu, ekip mesajları, hasta süreci, operasyon) */
.ib { display: flex; flex-direction: column; gap: 14px; }
.ib-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ib-head h2 { margin: 0; font-size: 1.35rem; font-weight: 800; color: #0f172a; }
.ib-head p { margin: 2px 0 0; font-size: .8rem; color: #64748b; }
.ib-btn { border: 1px solid #e2e8f0; background: #fff; color: #0f172a; border-radius: 10px; padding: 8px 14px; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ib-btn:hover { border-color: #93c5fd; }
.ib-btn.primary { background: linear-gradient(135deg, #10b981, #059669); border-color: transparent; color: #fff; }
.ib-btn.wide { width: 100%; }
.ib-btn:disabled { opacity: .6; }
.ib-tabs { display: flex; gap: 4px; padding: 4px; background: rgba(255,255,255,.7); border: 1px solid #e2e8f0; border-radius: 14px; overflow-x: auto; scrollbar-width: none; }
.ib-tabs button { border: none; background: transparent; padding: 9px 16px; border-radius: 10px; font: inherit; font-size: .84rem; font-weight: 800; color: #475569; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.ib-tabs button.active { background: #0f172a; color: #fff; }
.ib-tabs i { font-style: normal; background: #ef4444; color: #fff; border-radius: 999px; padding: 0 7px; font-size: .7rem; }
.ib-empty { padding: 26px 14px; text-align: center; color: #94a3b8; font-size: .84rem; }
.ib-empty.big { margin: auto; }
.ib-ch { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ib-row { display: flex; gap: 8px; }
.ib-row > * { flex: 1; min-width: 0; }
.ib-time { font-size: .7rem; font-weight: 700; color: #7c3aed; background: #f5f3ff; border-radius: 6px; padding: 1px 7px; white-space: nowrap; }

/* Gelen kutusu: iki sütun (Hastalardan / Doktorlardan Gelenler) */
.ib-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.ib-col { background: #fff; border: 1px solid #e2e8f0; border-radius: 18px; padding: 16px; min-width: 0; }
.ib-col-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ib-col-head h3 { margin: 0; font-size: 1.02rem; font-weight: 800; color: #0f172a; }
.ib-count { font-size: .72rem; color: #64748b; font-weight: 700; }
.ib-feed { display: flex; flex-direction: column; gap: 8px; max-height: 64vh; overflow-y: auto; }
.ib-feed-item { display: flex; flex-direction: column; gap: 6px; text-align: left; border: 1px solid #f1f5f9; background: #fff; border-radius: 14px; padding: 10px 12px; font: inherit; cursor: pointer; }
.ib-feed-item:hover { border-color: #bbf7d0; }
.ib-feed-item.unread { border-color: #86efac; background: #f0fdf4; }
.ib-feed-item.staff { cursor: default; }
.ib-feed-item.staff.unread { border-color: #c4b5fd; background: #faf5ff; }
.ib-feed-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ib-name { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 800; color: #0f172a; background: #fef3c7; border-radius: 6px; padding: 2px 8px; }
.ib-name.staff { background: #e0f2fe; }
.ib-name small { font-weight: 600; color: #64748b; }
.ib-bubble { font-size: .84rem; color: #14532d; background: #dcfce7; border-radius: 10px; padding: 7px 10px; line-height: 1.4; word-break: break-word; }
.ib-bubble.staff { color: #1e3a8a; background: #e0e7ff; }
.ib-link { align-self: flex-start; border: none; background: none; color: #0284c7; font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; padding: 0; }
.ib-compose { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; padding: 10px; border: 1px dashed #c7d2fe; border-radius: 14px; background: #f8fafc; }
.ib-compose select, .ib-compose input, .ib-form input, .ib-form select, .ib-form textarea, .ib-fields input, .ib-fields select, .ib-fields textarea, .ib-ops-head select, .ib-search input {
  font: inherit; font-size: .84rem; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; color: #0f172a; width: 100%; }

/* Sohbetler: üç bölme */
.ib-chat { display: grid; grid-template-columns: 300px 1fr 300px; height: calc(100vh - 330px); min-height: 520px; background: #fff; border: 1px solid #e2e8f0; border-radius: 18px; overflow: hidden; }
.ib-chat:not(.has-active) { grid-template-columns: 300px 1fr; }
.ib-list { border-right: 1px solid #eef2f7; display: flex; flex-direction: column; min-height: 0; }
.ib-search { padding: 10px; }
.ib-filters { display: flex; gap: 4px; padding: 0 10px 8px; flex-wrap: wrap; }
.ib-filters button { border: 1px solid #e2e8f0; background: #fff; border-radius: 999px; padding: 3px 9px; font: inherit; font-size: .72rem; font-weight: 700; color: #475569; cursor: pointer; display: inline-flex; align-items: center; }
.ib-filters button.active { background: #0f172a; color: #fff; border-color: #0f172a; }
.ib-convs { overflow-y: auto; flex: 1; }
.ib-conv { display: flex; gap: 10px; width: 100%; padding: 10px 12px; border: none; background: transparent; border-bottom: 1px solid #f8fafc; text-align: left; font: inherit; cursor: pointer; }
.ib-conv:hover { background: #f8fafc; }
.ib-conv.active { background: #ecfdf5; box-shadow: inset 3px 0 0 #10b981; }
.ib-av { position: relative; width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(135deg, #fb923c, #f59e0b); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .8rem; }
.ib-av .ib-ch { position: absolute; right: -4px; bottom: -3px; background: #fff; border-radius: 50%; padding: 1px; box-shadow: 0 0 0 1.5px #fff; }
.ib-av.sm { width: 34px; height: 34px; font-size: .72rem; }
.ib-av.lg { width: 64px; height: 64px; font-size: 1.2rem; }
.ib-conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ib-conv-main small { font-size: .66rem; color: #94a3b8; }
.ib-conv-main b { font-size: .86rem; color: #0f172a; }
.ib-prev { font-size: .76rem; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-stage { font-size: .68rem; font-weight: 700; }
.ib-conv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ib-conv-side i { font-style: normal; background: #10b981; color: #fff; border-radius: 999px; padding: 0 7px; font-size: .68rem; font-weight: 800; }
.ib-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #f8fafc; }
.ib-thread-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border-bottom: 1px solid #eef2f7; }
.ib-thread-head b { display: block; font-size: .9rem; } .ib-thread-head small { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; color: #64748b; }
.ib-back { display: none; border: none; background: #f1f5f9; width: 32px; height: 32px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; }
.ib-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.ib-msg { max-width: 72%; padding: 8px 12px 6px; border-radius: 14px; font-size: .86rem; line-height: 1.4; word-break: break-word; }
.ib-msg.in { align-self: flex-start; background: #fff; border: 1px solid #e2e8f0; border-top-left-radius: 4px; }
.ib-msg.out { align-self: flex-end; background: #10b981; color: #fff; border-top-right-radius: 4px; }
.ib-msg.out small { color: #d1fae5; }
.ib-msg.note { background: #fef3c7; color: #78350f; }
.ib-msg.note small { color: #92400e; }
.ib-msg.failed { background: #fee2e2; color: #7f1d1d; }
.ib-msg small { display: block; text-align: right; font-size: .66rem; color: #94a3b8; margin-top: 2px; }
.ib-msg em { display: block; font-size: .7rem; font-style: normal; margin-top: 4px; opacity: .85; }
.ib-hint { margin: 0 14px 8px; font-size: .74rem; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 7px 10px; border-radius: 10px; }
.ib-send { display: flex; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid #eef2f7; }
.ib-send input { flex: 1; font: inherit; font-size: .88rem; padding: 10px 14px; border: 1px solid #a7f3d0; border-radius: 999px; outline: none; }
.ib-side { border-left: 1px solid #eef2f7; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ib-prof { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.ib-prof b { font-size: 1rem; }
.ib-fields { display: flex; flex-direction: column; gap: 8px; }
.ib-fields label, .ib-form label { display: flex; flex-direction: column; gap: 4px; font-size: .72rem; font-weight: 700; color: #64748b; }
.ib-side-title { font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #94a3b8; margin-top: 4px; }
.ib-quick { display: flex; flex-direction: column; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; }
.ib-quick button { text-align: left; border: none; border-bottom: 1px solid #f1f5f9; background: #fff; padding: 10px 12px; font: inherit; font-size: .82rem; font-weight: 700; color: #0f172a; cursor: pointer; }
.ib-quick button:last-child { border-bottom: none; }
.ib-quick button:hover { background: #f0fdf4; }
.ib-stages { display: flex; flex-direction: column; gap: 2px; }
.ib-stages button { display: flex; align-items: center; gap: 8px; border: none; background: transparent; padding: 7px 8px; border-radius: 8px; font: inherit; font-size: .82rem; font-weight: 700; color: #475569; cursor: pointer; text-align: left; }
.ib-stages button span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--c); flex-shrink: 0; }
.ib-stages button.active { background: #f8fafc; color: #0f172a; }
.ib-stages button.active span { background: var(--c); box-shadow: inset 0 0 0 2px #fff; }

/* Hasta süreci panosu */
.ib-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.ib-lane { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px; display: flex; flex-direction: column; min-height: 320px; }
.ib-lane.over { border-color: #10b981; background: #f0fdf4; }
.ib-lane-head { display: flex; align-items: center; gap: 6px; padding: 12px; border-bottom: 1px solid #eef2f7; font-size: .82rem; }
.ib-lane-head span { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.ib-lane-head i { font-style: normal; color: #64748b; font-weight: 700; }
.ib-lane-head small { margin-left: auto; font-weight: 700; color: #0f172a; }
.ib-lane-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ib-lane-empty { font-size: .74rem; color: #cbd5e1; text-align: center; padding: 16px 0; }
.ib-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px; cursor: grab; display: flex; flex-direction: column; gap: 4px; }
.ib-card:hover { border-color: #93c5fd; box-shadow: 0 6px 16px rgba(15,23,42,.06); }
.ib-card.drag { opacity: .5; }
.ib-card-top { display: flex; justify-content: space-between; gap: 6px; } .ib-card-top b { font-size: .84rem; }
.ib-card small { font-size: .72rem; color: #64748b; }
.ib-card-foot { display: flex; justify-content: space-between; font-size: .7rem; color: #94a3b8; } .ib-card-foot b { color: #0f172a; }

/* Operasyon */
.ib-ops-head { display: flex; gap: 10px; align-items: center; }
.ib-ops-head select { max-width: 420px; }
.ib-ops { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.ib-ops-add { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.ib-ops-add button { display: flex; align-items: center; gap: 10px; border: none; background: #f8fafc; border-radius: 10px; padding: 10px 12px; font: inherit; font-size: .84rem; font-weight: 700; color: #0f172a; cursor: pointer; }
.ib-ops-add button b { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; background: #10b981; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.ib-ops-add button:hover { background: #ecfdf5; }
.ib-ops-days { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ib-share { font-size: .76rem; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 10px; padding: 8px 12px; word-break: break-all; }
.ib-day { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; overflow: hidden; }
.ib-day h4 { margin: 0; padding: 10px 14px; font-size: .72rem; letter-spacing: .05em; color: #64748b; background: #f8fafc; border-bottom: 1px solid #eef2f7; }
.ib-svc { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid #f8fafc; }
.ib-svc:last-child { border-bottom: none; }
.ib-svc-ic { width: 34px; height: 34px; border-radius: 10px; background: #f1f5f9; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ib-svc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ib-svc-main b { font-size: .86rem; } .ib-svc-main small { font-size: .74rem; color: #64748b; }
.ib-svc-st { align-self: flex-start; font-size: .66rem; font-weight: 800; border-radius: 999px; padding: 1px 8px; }
.ib-svc-time { font-family: 'JetBrains Mono', monospace; font-size: .8rem; font-weight: 700; }
.ib-svc-act { display: flex; gap: 4px; }
.ib-svc-act button { border: 1px solid #e2e8f0; background: #fff; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: .8rem; }

/* Kanallar */
.ib-chans { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.ib-chan { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px 14px; }
.ib-chan > div { flex: 1; min-width: 0; } .ib-chan b { display: block; font-size: .88rem; } .ib-chan small { font-size: .72rem; color: #64748b; }
.ib-chan-st { font-size: .7rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: #f1f5f9; color: #64748b; white-space: nowrap; }
.ib-chan-st.ok { background: #dcfce7; color: #15803d; }
.ib-card-box { margin-top: 14px; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 16px; font-size: .84rem; }
.ib-card-box p { color: #64748b; margin: 6px 0 10px; }
.ib-copy { display: flex; gap: 8px; } .ib-copy input { flex: 1; font: inherit; font-size: .8rem; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.ib-code { background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 12px; font-size: .74rem; overflow-x: auto; margin: 8px 0; }

/* Pencere */
.ib-modal { position: fixed; inset: 0; z-index: 4000; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ib-modal-box { background: #fff; border-radius: 20px; padding: 20px; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; box-shadow: 0 30px 70px rgba(15,23,42,.3); }
.ib-modal-box h3 { margin: 0 0 14px; font-size: 1.05rem; } .ib-modal-box h3 small { color: #64748b; font-weight: 600; font-size: .8rem; }
.ib-form { display: flex; flex-direction: column; gap: 10px; }
.ib-modal-act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

@media (max-width: 1100px) {
  .ib-chat, .ib-chat:not(.has-active) { grid-template-columns: 260px 1fr; }
  .ib-side { display: none; }
}
@media (max-width: 768px) {
  .ib-two { grid-template-columns: 1fr; }
  .ib-feed { max-height: none; }
  .ib-chat, .ib-chat:not(.has-active) { grid-template-columns: 1fr; height: calc(100dvh - 300px); min-height: 380px; }
  .ib-head p { display: none; }
  .ib-head { align-items: center; }
  .ib-head h2 { font-size: 1.15rem; }
  .ib-head-act .ib-btn { padding: 7px 10px; font-size: .76rem; }
  .ib-thread-head small { flex-wrap: wrap; }
  .ib-info-btn { padding: 4px 9px; font-size: .68rem; white-space: nowrap; }
  .ib-chat.has-active .ib-list { display: none; }
  .ib-chat:not(.has-active) .ib-thread { display: none; }
  .ib-chat.has-active .ib-side { display: none; }
  .ib-back { display: inline-flex; align-items: center; justify-content: center; }
  .ib-msg { max-width: 86%; }
  .ib-ops { grid-template-columns: 1fr; }
  .ib-ops-add { flex-direction: row; flex-wrap: wrap; }
  .ib-ops-add .ib-side-title { width: 100%; }
  .ib-ops-add button { flex: 1 1 45%; }
  .ib-ops-head { flex-direction: column; align-items: stretch; }
  .ib-board { grid-auto-columns: 78vw; }
  .ib-modal { align-items: flex-end; padding: 0; }
  .ib-modal-box { border-radius: 22px 22px 0 0; max-width: none; }
  .ib-svc { flex-wrap: wrap; }
}
.ib-info-btn { display: none; margin-left: auto; border: 1px solid #a7f3d0; background: #ecfdf5; color: #047857; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .74rem; font-weight: 800; cursor: pointer; }
.ib-side-close { display: none; align-self: flex-end; border: none; background: #f1f5f9; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; }
@media (max-width: 1100px) {
  .ib-info-btn { display: inline-block; }
  .ib-chat.show-side .ib-side { display: flex !important; position: fixed; inset: 0; z-index: 3500; background: #fff; padding: 16px 16px 40px; }
  .ib-chat.show-side .ib-side-close { display: inline-block; }
}
.ib-btn.sm { padding: 5px 11px; font-size: .74rem; }
.ib-btn.danger { color: #dc2626; border-color: #fecaca; }
.ib-chan-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ib-chan.on { border-color: #bbf7d0; }
.ib-chan-intro { margin: 0 0 12px; background: linear-gradient(135deg, #f0fdf4, #f0f9ff); border-color: #bbf7d0; }
.ib-steps { margin: 0 0 14px; padding-left: 18px; font-size: .8rem; color: #475569; line-height: 1.55; }
.ib-steps code, .ib-card-box code { background: #f1f5f9; padding: 1px 5px; border-radius: 5px; font-size: .74rem; word-break: break-all; }
.ib-form details { border: 1px dashed #e2e8f0; border-radius: 10px; padding: 8px 10px; }
.ib-form details summary { font-size: .78rem; font-weight: 700; color: #475569; cursor: pointer; }
.ib-form details label { margin-top: 8px; }
.ib-form label small { font-weight: 500; color: #94a3b8; }
.ib-check { flex-direction: row !important; align-items: center; gap: 8px !important; font-size: .8rem !important; color: #334155 !important; }
.ib-check input { width: auto !important; }

/* WhatsApp 24 saat kuralı: açılış mesajı kutusu */
.ib-optin { display: flex; align-items: center; gap: 14px; margin: 0 14px 12px; padding: 14px 16px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 14px; color: #78350f; }
.ib-optin[hidden] { display: none; }
.ib-optin-ic { font-size: 1.4rem; flex: none; }
.ib-optin-txt { flex: 1; min-width: 0; }
.ib-optin-txt b { display: block; font-size: .9rem; color: #92400e; }
.ib-optin-txt p { margin: 4px 0 8px; font-size: .78rem; line-height: 1.45; }
.ib-optin-prev { font-size: .78rem; background: #fff; border: 1px dashed #fcd34d; border-radius: 10px; padding: 8px 10px; color: #374151; font-style: italic; }
.ib-optin-txt small { display: block; margin-top: 6px; color: #b91c1c; font-size: .74rem; }
.ib-optin .ib-btn { flex: none; background: #16a34a; border-color: #16a34a; white-space: nowrap; }
.ib-optin .ib-btn:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 760px) { .ib-optin { flex-direction: column; align-items: stretch; text-align: left; } .ib-optin-ic { display: none; } }

/* kanal bağlama rehberi: tıkla-al-yapıştır */
.ib-guide li { margin-bottom: 9px; }
.ib-glink { display: inline-flex; align-items: center; gap: 3px; margin: 3px 4px 0 0; padding: 3px 10px; border-radius: 999px; background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; font-weight: 700; font-size: .74rem; text-decoration: none; white-space: nowrap; }
.ib-glink:hover { background: #dbeafe; }
.ib-gpair { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 5px; font-size: .76rem; color: #334155; }
.ib-gcopy { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.ib-gcopy code { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.ib-btn.sm { padding: 3px 10px; font-size: .72rem; }

/* WhatsApp tarzı iletim işaretleri */
.ib-msg small { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.ib-tick { flex: none; display: inline-block; margin-left: 1px; }
.ib-msg.out .ib-tick.sent, .ib-msg.out .ib-tick.dlv { color: rgba(255,255,255,.92); }
.ib-msg.out .ib-tick.read { color: #1e9bff; stroke: #1e9bff; stroke-width: .45; filter: drop-shadow(0 0 .6px rgba(0,40,80,.45)); }
.ib-msg.out .ib-tick.sent, .ib-msg.out .ib-tick.dlv { stroke: currentColor; stroke-width: .3; }
.ib-tick.fail { width: 14px; height: 14px; border-radius: 50%; background: #ef4444; color: #fff; font: 800 10px/14px system-ui, sans-serif; text-align: center; }
