/* ── Inbox Mocker ───────────────────────────────────────────────────────────── */
.jwt-section { padding: 14px 20px; border-bottom: 1px solid var(--color-border-lt); background: #fffbf0; }
.jwt-section label { font-size: var(--font-sm); font-weight: 600; color: #555; display: block; margin-bottom: 6px; }
.jwt-section textarea { width: 100%; height: 58px; font-size: var(--font-xs); font-family: monospace; border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 6px 8px; resize: none; }
.mock-channel-banner { margin: var(--space-sm) 20px; padding: 10px 12px; background: #fff3e0; border: 1px solid #ffcc80; border-radius: var(--radius-md); font-size: var(--font-sm); color: #e65100; }
.mock-channel-banner strong { display: block; margin-bottom: 2px; }
.channels-list { flex: 1; overflow-y: auto; padding: var(--space-sm) 0; }
.compose-area {
  flex: 1;
  overflow: hidden;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Empty, new, and chat view containers */
#ib-main-empty,
#ib-main-new,
#ib-main-chat {
  display: none;
}

#ib-main-chat {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
  background: white;
  border: 1px solid #e0e0e0;
  overflow: hidden;
}

/* Chat messages container - scrollable */
#ib-chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8f9fa;
}

/* Message input footer - sticky at bottom */
#ib-main-chat > div:last-child {
  flex-shrink: 0;
  padding: 12px 14px;
  background: white;
  border-top: 1px solid #e0e0e0;
}
.section-header { font-size: var(--font-lg); font-weight: 600; margin: 0 0 18px; color: var(--color-navy); }

/* ── Inbox Thread List ──────────────────────────────────────────────────────── */
.ib-left {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
}
.ib-thread-list-hdr {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border-lt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--color-surface);
}
#ib-thread-list { flex: 1; overflow-y: auto; }
.ib-thread-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.12s;
  position: relative;
}
.ib-thread-item:hover { background: #f5f6ff; }
.ib-thread-item.active {
  background: #eef0fb;
  border-left: 3px solid var(--color-indigo);
  padding-left: 13px;
}
.ib-thread-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  background: linear-gradient(135deg, #5c6bc0, #7986cb);
}
.ib-thread-info { flex: 1; min-width: 0; }
.ib-thread-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ib-thread-booking {
  font-size: 10px;
  color: #aaa;
  font-weight: 400;
  margin-top: 1px;
}
.ib-thread-status {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  margin-top: 2px;
  background: #e8f5e9;
  color: #388e3c;
  text-transform: capitalize;
}
.ib-thread-status.cancelled { background: #fce4ec; color: #c62828; }
.ib-thread-status.pending   { background: #fff8e1; color: #f57f17; }
.ib-thread-status.completed { background: #e8eaf6; color: #3949ab; }
.ib-thread-preview {
  font-size: 11px;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 3px;
}
.ib-thread-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.ib-thread-time { font-size: 10px; color: #bbb; }
.ib-setup-bottom { border-top: 1px solid var(--color-border-lt); flex-shrink: 0; }
.ib-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--color-bg); }

/* ── Inbox Chat Bubbles ─────────────────────────────────────────────────────── */
.ib-msg-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ib-msg-row.outgoing { align-items: flex-end; }
.ib-msg-row.incoming { align-items: flex-start; }

.ib-bubble-sender {
  font-size: 10px;
  color: #aaa;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 0 6px;
}

.ib-bubble {
  max-width: 72%;
  padding: 9px 13px;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  font-size: var(--font-md);
  line-height: 1.5;
  word-break: break-word;
  background: #ffffff;
  border: 1px solid #e8e8e8;
  color: #333;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  transition: box-shadow 0.15s;
}
.ib-bubble:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.1); }

.ib-bubble.outgoing {
  background: var(--color-indigo);
  color: #fff;
  border: none;
  border-radius: 18px;
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 18px;
  box-shadow: 0 2px 6px rgba(92,107,192,0.35);
}
.ib-bubble.outgoing:hover { box-shadow: 0 3px 10px rgba(92,107,192,0.45); }

.ib-bubble-time {
  font-size: 10px;
  color: #bbb;
  padding: 0 6px;
}
.ib-bubble-time.outgoing { text-align: right; color: rgba(92,107,192,0.7); }

/* ── Empty States ───────────────────────────────────────────────────────────── */
.ib-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 24px;
  text-align: center;
}
.ib-empty-icon {
  width: 64px;
  height: 64px;
  opacity: 0.55;
}
.ib-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: #555;
  margin: 0;
}
.ib-empty-sub {
  font-size: 12px;
  color: #aaa;
  line-height: 1.6;
  max-width: 240px;
  margin: -4px 0 0;
}

.ib-thread-empty {
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #ccc;
  font-size: 12px;
  text-align: center;
}
.ib-thread-empty svg { opacity: 0.4; margin-bottom: 4px; }

/* ── Send Button Spinner ─────────────────────────────────────────────────────── */
@keyframes ib-spin {
  to { transform: rotate(360deg); }
}
.ib-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-indigo);
  color: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s;
  position: relative;
}
.ib-send-btn:hover:not(:disabled) { background: #4f5bb0; }
.ib-send-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.ib-send-btn .ib-btn-icon { line-height: 1; }
.ib-send-btn .ib-btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ib-spin 0.7s linear infinite;
}
.ib-send-btn.loading .ib-btn-icon    { display: none; }
.ib-send-btn.loading .ib-btn-spinner { display: block; }

/* ── Inline compose inputs (dark header bg) ────────────────────────────────── */
.ib-compose-input {
  padding: 6px 10px;
  font-size: var(--font-sm);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  outline: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  width: 100%;
  transition: background 0.15s;
}
.ib-compose-input:focus { background: rgba(255,255,255,0.22); }
.ib-compose-input::placeholder { color: rgba(255,255,255,0.5); }
.ib-compose-select {
  padding: 6px 10px;
  font-size: var(--font-sm);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  outline: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  width: 100%;
}
.ib-compose-select option { color: #333; background: var(--color-surface); }
