body {
  background-color: #f4f6f9;
}

.login-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: url("icloud-bg.jpg") center/cover no-repeat fixed;
  overflow: hidden;
  z-index: 2000;
  opacity: 0;
  transition: opacity 220ms ease;
}

.login-overlay.show {
  display: flex;
  opacity: 1;
}

.login-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  z-index: 0;
}

.login-box {
  width: 360px;
  transform: translateY(8px) scale(0.98);
  transition: transform 220ms ease, opacity 220ms ease;
  opacity: 0;
  z-index: 2;
}

@media (max-width: 576px) {
  .login-box {
    width: 90%;
  }
}

.login-overlay.show .login-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.login-box .card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  color: #e5e7eb;
}

.login-box .card-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
}

.login-bubbles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.login-bubbles span {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.08) 60%, rgba(255, 255, 255, 0.02) 100%);
  box-shadow: inset -10px -10px 30px rgba(255, 255, 255, 0.08), 0 8px 30px rgba(15, 23, 42, 0.35);
  filter: blur(0.2px);
  animation: floatBubble 24s ease-in-out infinite;
  opacity: 0.55;
}

.login-bubbles span:nth-child(1) { width: 120px; height: 120px; left: 8%; top: 15%; animation-duration: 20s; }
.login-bubbles span:nth-child(2) { width: 200px; height: 200px; left: 72%; top: 8%; animation-duration: 26s; }
.login-bubbles span:nth-child(3) { width: 90px; height: 90px; left: 18%; top: 65%; animation-duration: 22s; }
.login-bubbles span:nth-child(4) { width: 160px; height: 160px; left: 60%; top: 60%; animation-duration: 24s; }
.login-bubbles span:nth-child(5) { width: 70px; height: 70px; left: 40%; top: 25%; animation-duration: 18s; }
.login-bubbles span:nth-child(6) { width: 110px; height: 110px; left: 82%; top: 45%; animation-duration: 21s; }
.login-bubbles span:nth-child(7) { width: 140px; height: 140px; left: 5%; top: 40%; animation-duration: 27s; }
.login-bubbles span:nth-child(8) { width: 60px; height: 60px; left: 48%; top: 75%; animation-duration: 19s; }

@keyframes floatBubble {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  30% { transform: translate3d(8px, -14px, 0) scale(1.01); }
  60% { transform: translate3d(-6px, 18px, 0) scale(1.02); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

.login-bubbles span:nth-child(odd) { animation-direction: alternate; }
.login-bubbles span:nth-child(even) { animation-direction: alternate-reverse; }

.icloud-login .card-header {
  text-align: center;
  padding: 14px 16px 6px;
}

.icloud-logo-image {
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  max-width: 100%;
  display: block;
  margin: 0 auto;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  mix-blend-mode: normal;
}

@media (max-width: 576px) {
  .icloud-logo-image {
    max-height: 170px;
  }
}

.icloud-login .card-body {
  padding: 18px 20px 22px;
}

.icloud-login .form-control {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

.icloud-login .form-control::placeholder {
  color: rgba(248, 250, 252, 0.6);
}

.icloud-login .btn-primary {
  background: linear-gradient(180deg, #4f46e5 0%, #3b82f6 100%);
  border: none;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.icloud-login .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

.icloud-login .btn-primary:active {
  transform: translateY(0);
}

.icloud-login .btn-outline-secondary {
  color: #e5e7eb;
  border-color: rgba(255, 255, 255, 0.2);
}

.avatar-badge {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #1f2a37;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
}

.conversation-list .item {
  border: none;
  border-bottom: 1px solid #e9ecef;
  border-radius: 0;
  padding: 10px 12px;
  cursor: pointer;
  background: transparent;
}

.conversation-list .item:hover {
  background: #f5f7fa;
}

.conversation-list .item.active {
  background: #e9f0ff;
}

.conversation-layout {
  min-height: 680px;
  border-radius: 16px;
  overflow: hidden;
}

.conversation-pane,
.chat-pane,
.detail-pane {
  background: #f8fafc;
}

.conversation-pane .card,
.chat-pane .card,
.detail-pane .card {
  border: none;
  border-radius: 0;
}

.conversation-pane .card-body,
.chat-pane .card-body,
.detail-pane .card-body {
  background: #fff;
}

.conversation-header,
.chat-header {
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filter-tabs .btn {
  border-radius: 999px;
  font-size: 12px;
  padding: 6px 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #16a34a;
  font-size: 12px;
  font-weight: 600;
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  background: #16a34a;
  border-radius: 50%;
}

.conversation-item {
  padding: 12px 14px;
}

.conversation-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.conversation-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.conversation-content {
  flex: 1;
  min-width: 0;
}

.conversation-time {
  font-size: 11px;
  color: #94a3b8;
  flex-shrink: 0;
}

.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #1f2937;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-body {
  min-height: 560px;
}

.chat-messages {
  flex: 1;
  overflow: auto;
  padding: 18px;
  border: none;
  border-radius: 0;
  background: #f8fafc;
  max-height: 560px;
}

.chat-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 14px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.chat-bubble.inbound {
  background: #ffffff;
  color: #0f172a;
  margin-right: auto;
}

.chat-bubble.outbound {
  background: #2563eb;
  color: #fff;
  margin-left: auto;
}

.chat-input-wrap {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e9ecef;
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 8px 12px;
}

.chat-input .form-control {
  border: none;
  background: transparent;
  box-shadow: none;
}

.chat-input .form-control:focus {
  box-shadow: none;
}

.icon-btn {
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.btn-crud {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  border-radius: 10px;
  padding: 8px 14px;
}

.btn-crud i {
  font-size: 14px;
}

.btn-crud.btn-sm {
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 600;
}

.chat-body {
  min-height: 520px;
}

.chat-messages {
  flex: 1;
  overflow: auto;
  padding: 8px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background: #fff;
  max-height: 480px;
}

.chat-bubble {
  max-width: 70%;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.4;
}

.chat-bubble.inbound {
  background: #f1f5f9;
  color: #111827;
  margin-right: auto;
}

.chat-bubble.outbound {
  background: #2563eb;
  color: #fff;
  margin-left: auto;
}

.list-group .item {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 10px 12px;
}

.metric-card {
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}

.metric-label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

@media (max-width: 992px) {
  .chat-body {
    min-height: 420px;
  }
}
