/* CBK UI upgrade: chat, notifications and Gantt polish. */

.cbk-chat-window {
  width: min(calc(100vw - 1.25rem), 520px) !important;
  height: min(560px, calc(100vh - 6.25rem)) !important;
  max-height: calc(100vh - 6.25rem) !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24), 0 3px 12px rgba(15, 23, 42, .12) !important;
}

.cbk-chat-sidebar {
  width: 172px !important;
  background: #f7f8fa !important;
}

.cbk-chat-sidebar-head {
  background: #fff !important;
}

.cbk-chat-search,
.cbk-chat-input {
  border-radius: 999px !important;
  background: #f0f2f5 !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.cbk-chat-thread {
  border-radius: 12px !important;
}

.cbk-chat-thread-active {
  background: #e7f3ff !important;
  color: #0866ff !important;
}

.cbk-chat-avatar {
  background: linear-gradient(135deg, #e7f3ff, #dbeafe) !important;
  color: #0866ff !important;
}

.cbk-chat-header {
  min-height: 62px !important;
  background: #fff !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .06) !important;
}

.cbk-chat-close {
  border-radius: 999px !important;
  width: 30px !important;
  height: 30px !important;
}

.cbk-chat-messages {
  padding: 12px !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(8, 102, 255, .055), transparent 28%),
    linear-gradient(180deg, #f7f8fb 0%, #ffffff 100%) !important;
}

.cbk-chat-row {
  align-items: flex-end !important;
  gap: 7px !important;
}

.cbk-chat-bubble {
  max-width: 76% !important;
  border: 0 !important;
  border-radius: 18px !important;
  padding: 8px 11px !important;
  box-shadow: none !important;
}

.cbk-chat-bubble-out {
  background: #0866ff !important;
  color: #fff !important;
  border-bottom-right-radius: 5px !important;
}

.cbk-chat-bubble-in {
  background: #f0f2f5 !important;
  color: #050505 !important;
  border-bottom-left-radius: 5px !important;
}

.cbk-chat-text {
  font-size: 13px !important;
  line-height: 1.35 !important;
}

.cbk-chat-sender {
  color: #65676b !important;
  font-size: 10px !important;
}

.cbk-chat-time {
  font-size: 9px !important;
  opacity: .76 !important;
}

.cbk-chat-attachment {
  max-width: 210px !important;
}

.cbk-chat-image {
  display: block !important;
  width: auto !important;
  max-width: min(210px, 100%) !important;
  max-height: 145px !important;
  object-fit: contain !important;
  background: rgba(255, 255, 255, .88) !important;
  border-radius: 14px !important;
}

.cbk-chat-delete {
  opacity: 0 !important;
  transition: opacity .16s ease !important;
}

.cbk-chat-attachment:hover .cbk-chat-delete {
  opacity: .95 !important;
}

.cbk-chat-composer {
  background: #fff !important;
  padding: 9px 10px !important;
}

.cbk-chat-composer-row {
  align-items: center !important;
}

.cbk-chat-attach,
.cbk-chat-send {
  border-radius: 999px !important;
  height: 36px !important;
  min-width: 36px !important;
  padding: 0 12px !important;
}

.cbk-chat-send {
  background: #0866ff !important;
}

.cbk-chat-fab {
  width: 56px !important;
  height: 56px !important;
  background: linear-gradient(135deg, #0866ff, #00a3ff) !important;
  box-shadow: 0 14px 34px rgba(8, 102, 255, .34) !important;
}

.cbk-chat-fab svg {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .16));
}

.cbk-chat-fab-badge {
  line-height: 1 !important;
  box-shadow: 0 8px 18px rgba(220, 38, 38, .34) !important;
}

.cbk-notification-button {
  border-radius: 999px !important;
  background: #f0f2f5 !important;
}

.cbk-notification-panel {
  border-radius: 16px !important;
  background: rgba(255, 255, 255, .98) !important;
  box-shadow: 0 22px 58px rgba(15, 23, 42, .22) !important;
}

.cbk-notification-panel > div:not(:first-child) {
  border-radius: 12px !important;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease !important;
}

.cbk-notification-panel > div:not(:first-child):hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}

main:has(header [class*="tracking-wider"]) {
  background:
    radial-gradient(circle at 20% 0%, rgba(8, 102, 255, .075), transparent 28%),
    radial-gradient(circle at 90% 12%, rgba(20, 184, 166, .08), transparent 26%);
}

main header.bg-card {
  border-radius: 14px !important;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .07) !important;
}

main header.bg-card + * {
  animation: cbkPanelIn .22s ease-out both;
}

main table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

main th {
  background: rgba(248, 250, 252, .92) !important;
  backdrop-filter: blur(8px);
}

main td,
main th {
  border-color: rgba(148, 163, 184, .18) !important;
}

main button {
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease !important;
}

main button:hover {
  transform: translateY(-1px);
}

main .bg-card {
  box-shadow: 0 10px 28px rgba(15, 23, 42, .055);
}

@keyframes cbkPanelIn {
  from {
    opacity: .74;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .cbk-chat-window {
    width: calc(100vw - 1rem) !important;
    height: min(560px, calc(100vh - 5.75rem)) !important;
  }

  .cbk-chat-bubble {
    max-width: 82% !important;
  }

  .cbk-chat-image {
    max-width: min(190px, 100%) !important;
    max-height: 130px !important;
  }
}
