/* Bot-Auto Stylesheet - Deep Forest Emerald Smax-style Block Builder */

.bot-auto-view {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  overflow: hidden;
  background: var(--app-bg, #D8E2DA);
  color: var(--text-primary, #20382B);
}

.bot-studio-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* Header & Sub-nav */
.bot-auto-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  min-height: 46px;
  background: var(--surface-bg, #F3F6F3);
  border-bottom: 1px solid var(--border-default, #B6C8BB);
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Nút mũi tên thu gọn / mở rộng ở góc dưới bên phải thanh điều khiển */
.bot-header-collapse-toggle {
  position: absolute;
  right: 14px;
  bottom: -13px;
  z-index: 45;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1.5px solid #0B6047;
  color: #0B6047;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(11, 96, 71, 0.25);
  transition: all 0.2s ease;
  padding: 0;
  outline: none;
}

.bot-header-collapse-toggle:hover {
  background: #0B6047;
  color: #FFFFFF;
  transform: scale(1.12);
  box-shadow: 0 4px 10px rgba(11, 96, 71, 0.35);
}

/* Trạng thái thu gọn (Collapsed Header): tăng diện tích tối đa cho nội dung Block */
.bot-auto-header.is-collapsed {
  padding: 4px 16px;
  gap: 8px;
  background: #EEF4F0;
}

.bot-auto-header.is-collapsed .bot-page-link-selector,
.bot-auto-header.is-collapsed .bot-header-actions,
.bot-auto-header.is-collapsed .bot-header-divider {
  display: none !important;
}

.bot-auto-header.is-collapsed .bot-title-line h1 {
  font-size: 13px;
}

.bot-auto-header.is-collapsed .bot-back-to-list-btn {
  padding: 3px 10px;
  font-size: 11px;
}

.bot-auto-header.is-collapsed .bot-header-subnav {
  padding: 2px;
}

.bot-auto-header.is-collapsed .bot-subnav-btn {
  padding: 3px 10px;
  font-size: 11px;
}

.bot-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.bot-header-badge {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #0B6047, #063F32);
  color: #fff;
  border-radius: 10px;
  font-size: 20px;
  box-shadow: 0 2px 8px rgba(11, 96, 71, 0.25);
}

.bot-header-titles h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary, #20382B);
  display: flex;
  align-items: center;
  gap: 8px;
}

.bot-header-titles p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-secondary, #536B5B);
}

.bot-header-subnav {
  display: flex;
  background: #E2ECE5;
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}

.bot-subnav-btn {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 6px;
  font: 600 12px var(--ui-font, system-ui, sans-serif);
  color: var(--text-secondary, #536B5B);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bot-subnav-btn:hover {
  color: var(--text-primary, #20382B);
  background: rgba(255, 255, 255, 0.5);
}

.bot-subnav-btn.active {
  background: #FFFFFF;
  color: #0B6047;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.bot-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bot-master-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #E2ECE5;
  border-radius: 20px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary, #20382B);
  user-select: none;
}

.bot-master-toggle input {
  display: none;
}

.bot-toggle-track {
  width: 34px;
  height: 18px;
  background: #B6C8BB;
  border-radius: 10px;
  position: relative;
  transition: background 0.2s;
}

.bot-toggle-track::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}

.bot-master-toggle input:checked + .bot-toggle-track {
  background: #0B6047;
}

.bot-master-toggle input:checked + .bot-toggle-track::after {
  transform: translateX(16px);
}

.bot-action-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  font: 600 11px var(--ui-font, system-ui, sans-serif);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.bot-btn-primary {
  background: #0B6047;
  color: #FFFFFF;
  border: 0;
}

.bot-btn-primary:hover {
  background: #074A36;
}

.bot-btn-secondary {
  background: #FFFFFF;
  color: #20382B;
  border: 1px solid var(--border-default, #B6C8BB);
}

.bot-btn-secondary:hover {
  background: #F0F4F1;
}

/* Bot View Body Container */
.bot-tab-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.bot-tab-pane {
  display: none;
  height: 100%;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.bot-tab-pane.active {
  display: flex;
  flex-direction: column;
}

/* Structures Layout: 4 Columns (Left: Blocks list 210px, Middle: Canvas 1fr, Palette: 230px, Right: Live Simulator 330px) */
.bot-structures-layout {
  display: grid;
  grid-template-columns: 210px 1fr 230px 330px;
  height: 100%;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

/* Left Column: Blocks Rail (Thu nhỏ bớt theo yêu cầu) */
.bot-blocks-rail {
  background: var(--surface-bg, #F3F6F3);
  border-right: 1px solid var(--border-default, #B6C8BB);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  width: 225px;
  min-width: 225px;
  overflow: hidden;
}

.bot-rail-search {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-default, #B6C8BB);
}

.bot-search-input-wrap {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid var(--border-default, #B6C8BB);
  border-radius: 6px;
  padding: 4px 8px;
  gap: 6px;
}

.bot-search-input-wrap input {
  border: 0;
  outline: 0;
  width: 100%;
  font-size: 11px;
  color: var(--text-primary, #20382B);
  background: transparent;
}

.bot-rail-actions {
  display: flex;
  padding: 8px 8px;
  gap: 5px;
  border-bottom: 1px solid var(--border-default, #B6C8BB);
  background: #E8EFEA;
}

.bot-rail-actions button {
  flex: 1;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid var(--border-default, #B6C8BB);
  background: #FFFFFF;
  color: #20382B;
}

.bot-rail-actions button:hover {
  background: #F0F4F1;
}

.bot-rail-actions button.bot-btn-primary,
#botAddBlockBtn {
  background: #0B6047 !important;
  color: #FFFFFF !important;
  border-color: #0B6047 !important;
}

.bot-rail-actions button.bot-btn-primary:hover,
#botAddBlockBtn:hover {
  background: #084936 !important;
  border-color: #084936 !important;
}

.bot-blocks-tree {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bot-group-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bot-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #536B5B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: grab;
  user-select: none;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.bot-group-header:active {
  cursor: grabbing;
}

.bot-group-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bot-block-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: #FFFFFF;
  border: 1px solid #CFDDD3;
  border-radius: 6px;
  cursor: grab;
  user-select: none;
  transition: all 0.15s ease;
  position: relative;
}

.bot-block-item:active {
  cursor: grabbing;
}

.bot-block-item:hover {
  border-color: #0B6047;
  background: #F7FAF8;
}

.bot-block-item.active {
  background: #E6F3EC;
  border-color: #0B6047;
  box-shadow: 0 1px 4px rgba(11, 96, 71, 0.12);
}

.bot-block-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 3px;
  background: #0B6047;
  border-radius: 0 2px 2px 0;
}

.bot-block-title-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.bot-block-icon {
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
  color: #335544;
}

.bot-block-name {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-primary, #20382B);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.15px;
}

.bot-block-badge {
  font-size: 8.5px;
  font-weight: 600;
  padding: 1.5px 5px;
  border-radius: 10px;
  background: #CFE3D5;
  color: #173D29;
  flex-shrink: 0;
  margin-left: 4px;
}

.bot-block-badge.welcome {
  background: #FFF0D4;
  color: #8C5D00;
}

.bot-block-badge.fallback {
  background: #E8E3FA;
  color: #563D99;
}

.bot-block-controls {
  display: none;
  align-items: center;
  gap: 4px;
}

.bot-block-item:hover .bot-block-controls {
  display: flex;
}

.bot-block-control-btn {
  background: transparent;
  border: 0;
  padding: 2px 4px;
  font-size: 10px;
  color: #6C8274;
  cursor: pointer;
  border-radius: 3px;
}

.bot-block-control-btn:hover {
  background: #E2ECE5;
  color: #20382B;
}

/* Middle Column: Canvas & Cards Stack */
.bot-canvas-area {
  background: #E4ECE6;
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  padding: 20px 30px;
  position: relative;
}

.bot-canvas-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

#botBackToMapBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 12px;
  background: #FFFFFF;
  border: 1px solid #BED8C8;
  color: #0B6047;
  padding: 7px 16px;
  border-radius: 7px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.15s ease;
}

#botBackToMapBtn:hover {
  background: #E8F5EE;
  border-color: #0B6047;
  transform: translateX(-2px);
}

.bot-block-header-card {
  background: #FFFFFF;
  border: 1px solid var(--border-default, #B6C8BB);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.bot-block-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.bot-block-title-input {
  font-size: 16px;
  font-weight: 700;
  color: #0B6047;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 8px;
  width: 100%;
  max-width: 450px;
  outline: none;
  transition: all 0.2s;
}

.bot-block-title-input:hover,
.bot-block-title-input:focus {
  border-color: var(--border-default, #B6C8BB);
  background: #F7FAF8;
}

.bot-block-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.bot-block-meta-row label {
  font-size: 11px;
  color: #536B5B;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bot-block-meta-row select,
.bot-block-meta-row input[type="text"] {
  padding: 4px 8px;
  border: 1px solid var(--border-default, #B6C8BB);
  border-radius: 5px;
  font-size: 11px;
  background: #FFFFFF;
}

/* Card Stack */
.bot-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 30px;
}

.bot-card {
  background: #FFFFFF;
  border: 1px solid #CFDDD3;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  transition: border-color 0.15s;
}

.bot-card:hover {
  border-color: #9EC0AB;
}

.bot-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #F7FAF8;
  border-bottom: 1px solid #E8EFEA;
}

.bot-card-type-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bot-card-type-badge.text { color: #0B6047; }
.bot-card-type-badge.typing { color: #536B5B; }
.bot-card-type-badge.image { color: #7B3E96; }
.bot-card-type-badge.quick_reply { color: #186088; }
.bot-card-type-badge.user_input { color: #A05B00; }
.bot-card-type-badge.set_attribute { color: #0D7A73; }
.bot-card-type-badge.tag { color: #8F302B; }
.bot-card-type-badge.goto_block { color: #3952B8; }
.bot-card-type-badge.bot_switch { color: #B33924; }

.bot-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bot-card-btn {
  background: transparent;
  border: 0;
  color: #799484;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.bot-card-btn:hover {
  background: #E5EFE8;
  color: #20382B;
}

.bot-card-body {
  padding: 16px;
}

/* Card Specific Controls */
.bot-text-editor-wrap textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 12px;
  border: 1px solid var(--border-default, #B6C8BB);
  border-radius: 7px;
  font: 12px/1.6 var(--ui-font, system-ui, sans-serif);
  color: var(--text-primary, #20382B);
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.bot-text-editor-wrap textarea:focus {
  border-color: #0B6047;
  box-shadow: 0 0 0 2px rgba(11, 96, 71, 0.12);
}

.bot-var-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.bot-var-label {
  font-size: 10px;
  color: #6C8274;
}

.bot-var-chip {
  background: #E7F1EB;
  border: 1px solid #BED8C8;
  color: #173D29;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.bot-var-chip:hover {
  background: #0B6047;
  color: #FFFFFF;
}

/* Buttons inside Text Card */
.bot-card-buttons-area {
  margin-top: 14px;
  border-top: 1px dashed #D2E0D6;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bot-buttons-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bot-button-row {
  display: grid;
  grid-template-columns: 140px 110px 1fr 30px;
  gap: 8px;
  align-items: center;
  background: #F7FAF8;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #CFDDD3;
}

.bot-button-row input,
.bot-button-row select {
  padding: 5px 8px;
  border: 1px solid #B6C8BB;
  border-radius: 4px;
  font-size: 11px;
  background: #FFFFFF;
}

.bot-add-button-btn {
  align-self: flex-start;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 5px;
  border: 1px dashed #0B6047;
  background: #E8F5EE;
  color: #0B6047;
  cursor: pointer;
}

.bot-add-button-btn:hover {
  background: #0B6047;
  color: #fff;
}

/* Image Card */
.bot-image-card-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.bot-image-preview {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  background: #E8EFEA;
  object-fit: cover;
  border: 1px solid #CFDDD3;
  flex-shrink: 0;
}

.bot-image-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bot-quick-preset-images {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bot-preset-btn {
  font-size: 10px;
  padding: 3px 8px;
  background: #EAEFEA;
  border: 1px solid #C4D5C8;
  border-radius: 4px;
  cursor: pointer;
}

.bot-preset-btn:hover {
  background: #CFE3D5;
}

/* User Input Card */
.bot-input-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.bot-input-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bot-input-field-group label {
  font-size: 11px;
  font-weight: 600;
  color: #536B5B;
}

.bot-input-field-group input,
.bot-input-field-group select {
  padding: 7px 10px;
  border: 1px solid var(--border-default, #B6C8BB);
  border-radius: 6px;
  font-size: 11px;
  background: #FFFFFF;
}

/* Add Elements Bar */
.bot-add-card-bar {
  background: #FFFFFF;
  border: 2px dashed #B6C8BB;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.bot-add-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #536B5B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bot-card-palette {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.bot-palette-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #F7FAF8;
  border: 1px solid #CFDDD3;
  border-radius: 8px;
  cursor: pointer;
  font: 600 11px var(--ui-font, system-ui, sans-serif);
  color: #20382B;
  transition: all 0.15s ease;
}

.bot-palette-btn:hover {
  background: #0B6047;
  color: #FFFFFF;
  border-color: #0B6047;
  transform: translateY(-1px);
}

/* Column 3: Vertical 34 Elements Palette (Dọc theo nội dung block) */
.bot-elements-rail {
  background: #FFFFFF;
  border-left: 1px solid #CFDDD3;
  border-right: 1px solid #CFDDD3;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  width: 230px;
  overflow: hidden;
  position: relative;
}

.bot-elements-rail-header {
  padding: 8px 10px;
  background: #F4F8F5;
  border-bottom: 1px solid #CFDDD3;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.bot-elements-header-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bot-elements-header-title strong {
  font-size: 11px;
  font-weight: 700;
  color: #0B6047;
  letter-spacing: 0.3px;
}

.bot-el-count-tag {
  background: #0B6047;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.bot-elements-header-sub {
  margin: 0;
  font-size: 10px;
  color: #64748B;
  line-height: 1.2;
}

.bot-elements-search-wrap {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid #BED8C8;
  border-radius: 5px;
  padding: 3px 6px;
  gap: 4px;
}

.bot-elements-search-wrap input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 10px;
  background: transparent;
  color: #20382B;
}

.bot-elements-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.bot-el-cat-pill {
  border: 1px solid #D1DFD6;
  background: #FFFFFF;
  color: #475569;
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s;
}

.bot-el-cat-pill:hover {
  border-color: #0B6047;
  color: #0B6047;
}

.bot-el-cat-pill.active {
  background: #0B6047;
  color: #FFFFFF;
  border-color: #0B6047;
}

.bot-elements-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bot-element-pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #FAFCFA;
  border: 1px solid #D9E4DC;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  position: relative;
  width: 100%;
}

.bot-element-pill-btn:hover {
  background: #EDF7F1;
  border-color: #0B6047;
  transform: translateX(2px);
  box-shadow: 0 1px 4px rgba(11, 96, 71, 0.12);
}

.bot-element-pill-btn .el-icon {
  font-size: 14px;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E8F5EE;
  flex-shrink: 0;
}

.bot-element-pill-btn .el-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.bot-element-pill-btn .el-name {
  font-size: 11px;
  font-weight: 600;
  color: #1E293B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bot-element-pill-btn .el-desc {
  font-size: 9.5px;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bot-element-pill-btn .el-add-indicator {
  font-size: 12px;
  font-weight: 700;
  color: #0B6047;
  opacity: 0;
  transition: opacity 0.15s;
}

.bot-element-pill-btn:hover .el-add-indicator {
  opacity: 1;
}

/* Right Column: Simulator Preview */
.bot-simulator-pane {
  background: var(--surface-bg, #F3F6F3);
  border-left: 1px solid var(--border-default, #B6C8BB);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
}

.bot-simulator-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-default, #B6C8BB);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  position: sticky;
  top: 0;
  z-index: 5;
}

.bot-simulator-header strong {
  font-size: 12px;
  color: var(--text-primary, #20382B);
  display: flex;
  align-items: center;
  gap: 6px;
}

.bot-phone-mockup {
  flex: 0 0 auto;
  min-height: 520px;
  margin: 12px;
  background: #FFFFFF;
  border-radius: 18px;
  border: 2px solid #20382B;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bot-phone-notch {
  height: 20px;
  background: #20382B;
  display: flex;
  justify-content: center;
  align-items: center;
}

.bot-phone-camera {
  width: 40px;
  height: 5px;
  background: #395243;
  border-radius: 3px;
}

.bot-phone-screen-header {
  background: #063F32;
  color: #FFFFFF;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bot-avatar-mock {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #145C43;
  display: grid;
  place-items: center;
  font-size: 14px;
  border: 1px solid #E8C77D;
}

.bot-screen-user-info h4 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
}

.bot-screen-user-info span {
  font-size: 9px;
  color: #A9D1B7;
}

.bot-phone-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #F0F4F1;
}

.bot-sim-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: simFadeIn 0.2s ease-out;
}

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

.bot-sim-msg.bot {
  align-self: flex-start;
}

.bot-sim-msg.user {
  align-self: flex-end;
}

.bot-sim-bubble {
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 11px;
  line-height: 1.5;
  word-break: break-word;
}

.bot-sim-msg.bot .bot-sim-bubble {
  background: #FFFFFF;
  color: #20382B;
  border: 1px solid #D5E2D9;
  border-bottom-left-radius: 4px;
}

.bot-sim-msg.user .bot-sim-bubble {
  background: #0B6047;
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.bot-sim-image {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 4px;
}

.bot-sim-buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.bot-sim-button {
  padding: 6px 10px;
  background: #E8F5EE;
  border: 1px solid #BED8C8;
  color: #0B6047;
  font: 600 10px var(--ui-font, system-ui, sans-serif);
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.bot-sim-button:hover {
  background: #0B6047;
  color: #FFFFFF;
}

.bot-sim-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.bot-sim-qr-btn {
  padding: 4px 8px;
  background: #FFFFFF;
  border: 1px solid #0B6047;
  color: #0B6047;
  font-size: 10px;
  border-radius: 12px;
  cursor: pointer;
}

.bot-sim-qr-btn:hover {
  background: #0B6047;
  color: #FFFFFF;
}

/* Typing animation */
.bot-sim-typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #FFFFFF;
  border: 1px solid #D5E2D9;
  border-radius: 14px;
  width: fit-content;
}

.bot-sim-typing-dot {
  width: 5px;
  height: 5px;
  background: #6C8274;
  border-radius: 50%;
  animation: botTypingBounce 1.2s infinite ease-in-out;
}

.bot-sim-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.bot-sim-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes botTypingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

.bot-phone-input-bar {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  background: #FFFFFF;
  border-top: 1px solid #D5E2D9;
  gap: 6px;
}

.bot-phone-input-bar input {
  flex: 1;
  border: 1px solid #CFDDD3;
  border-radius: 16px;
  padding: 6px 10px;
  font-size: 11px;
  outline: none;
}

.bot-phone-input-bar button {
  background: #0B6047;
  color: #fff;
  border: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 12px;
}

/* Attributes Viewer in Simulator */
.bot-sim-attr-box {
  margin: 0 12px 12px;
  padding: 8px 12px;
  background: #FFFFFF;
  border: 1px solid #CFDDD3;
  border-radius: 8px;
  font-size: 10px;
}

.bot-sim-attr-header {
  font-weight: 700;
  color: #536B5B;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.bot-sim-attr-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  color: #20382B;
}

/* Tab 2: Keywords Studio */
.bot-keywords-layout {
  padding: 24px 30px;
  overflow-y: auto;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--app-bg, #D8E2DA);
}

.bot-section-box {
  background: #FFFFFF;
  border: 1px solid var(--border-default, #B6C8BB);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.bot-keywords-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 14px;
}

.bot-keywords-table th {
  text-align: left;
  padding: 10px 12px;
  background: #F0F5F1;
  color: #536B5B;
  border-bottom: 1px solid #CFDDD3;
  font-weight: 600;
}

.bot-keywords-table td {
  padding: 12px;
  border-bottom: 1px solid #E8EFEA;
  vertical-align: middle;
}

.bot-keywords-table tr:hover td {
  background: #F7FAF8;
}

/* Tab 3 & 4 (Menu & Comments) */
.bot-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Inbox Thread Integration Button */
.bot-toggle-thread-button {
  background: #E8F5EE;
  color: #0B6047;
  border: 1px solid #BED8C8;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 11px;
  cursor: pointer;
}

.bot-toggle-thread-button.paused {
  background: #FFF1F0;
  color: #CF1322;
  border-color: #FFA39E;
}

.send-bot-block-btn {
  background: #E8F5EE;
  color: #0B6047;
  font-weight: 600;
  border: 1px solid #BED8C8;
}

/* Send Block Dialog / Popover */
.bot-quick-send-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.bot-quick-send-card {
  width: 440px;
  max-width: 90vw;
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.bot-quick-send-header {
  padding: 14px 18px;
  background: #F3F7F4;
  border-bottom: 1px solid #CFDDD3;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bot-quick-send-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bot-quick-send-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #F8FAF9;
  border: 1px solid #CFDDD3;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.bot-quick-send-item:hover {
  background: #E6F3EC;
  border-color: #0B6047;
}

/* Responsive */
@media (max-width: 1200px) {
  .bot-structures-layout {
    grid-template-columns: 240px 1fr 300px;
  }
}

@media (max-width: 900px) {
  .bot-structures-layout {
    grid-template-columns: 220px 1fr;
  }
  .bot-simulator-pane {
    display: none;
  }
}

/* ==========================================================================
   BOT MAP FLOW CANVAS (SMAX-STYLE VISUAL NODE GRAPH & WIRE CONNECTORS)
   ========================================================================== */

.bot-studio-layout {
  display: flex;
  width: 100%;
  flex: 1;
  min-height: 0;
  height: calc(100% - 46px);
  overflow: hidden;
  background: #F8FAFC;
}

.bot-studio-layout .bot-tab-content {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  position: relative;
}

.bot-map-layout {
  display: flex;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #F8FAFC;
}

/* Smax Leftmost Vertical Icon Dock (54px) */
.bot-smax-leftbar {
  width: 54px;
  min-width: 54px;
  height: 100%;
  background: #FFFFFF;
  border-right: 1px solid #E2E8F0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 3px;
  z-index: 15;
  user-select: none;
  overflow-y: auto;
}

.bot-smax-icon {
  width: 46px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  color: #64748B;
  transition: all 0.15s ease;
  position: relative;
}

.bot-smax-icon .icon {
  font-size: 15px;
  line-height: 1;
}

.bot-smax-icon .label {
  font-size: 8.5px;
  font-weight: 600;
  margin-top: 3px;
  white-space: nowrap;
}

.bot-smax-icon:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.bot-smax-icon.active {
  background: #EBF3FE;
  color: #2563EB;
}

.bot-smax-icon.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: #2563EB;
  border-radius: 0 3px 3px 0;
}

.bot-smax-divider {
  width: 32px;
  height: 1px;
  background: #E2E8F0;
  margin: 4px 0;
}

/* Left Sidebar Rail */
.bot-map-rail {
  width: 225px;
  min-width: 225px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  background: #FFFFFF;
  border-right: 1px solid #E2E8F0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

.bot-map-rail-header {
  padding: 10px 8px;
  border-bottom: 1px solid #E2E8F0;
  background: #F8FAFC;
  flex-shrink: 0;
}

.bot-map-quick-blocks {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bot-rail-block-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.bot-rail-block-btn .icon {
  font-size: 15px;
  width: 22px;
  text-align: center;
}

.bot-rail-block-btn .meta .name {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #1E293B;
}

.bot-rail-block-btn .meta small {
  display: block;
  font-size: 9.5px;
  color: #64748B;
}

.bot-rail-block-btn.default-welcome {
  border-color: #3B82F6;
  background: #EFF6FF;
}

.bot-rail-block-btn.default-welcome .icon {
  color: #2563EB;
}

.bot-rail-block-btn.default-fallback {
  border-color: #94A3B8;
  background: #F8FAFC;
}

.bot-rail-block-btn:hover {
  border-color: #2563EB;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.12);
}

.bot-map-rail-actions {
  padding: 8px 8px;
  border-bottom: 1px solid #E2E8F0;
  background: #FFFFFF;
  flex-shrink: 0;
}

.bot-map-folders-list {
  flex: 1 1 0;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: auto;
  padding: 8px 8px 50px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bot-folder-item {
  display: flex;
  flex-direction: column;
}

.bot-folder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: #1E293B;
  padding: 6px 8px;
  background: #F1F5F9;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.bot-folder-header:hover {
  background: #E2E8F0;
}

.bot-folder-badge {
  background: #CBD5E1;
  color: #0F172A;
  font-size: 9.5px;
  padding: 1px 7px;
  border-radius: 12px;
  font-weight: 700;
}

.bot-folder-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.bot-group-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #0B6047;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: all 0.15s ease;
}

.bot-group-add-btn:hover {
  background: #0B6047;
  color: #FFFFFF;
  border-color: #0B6047;
  transform: scale(1.12);
}

.bot-group-del-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #64748B;
  font-size: 11px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: all 0.15s ease;
  opacity: 0.7;
}

.bot-folder-header:hover .bot-group-del-btn,
.bot-group-header:hover .bot-group-del-btn {
  opacity: 1;
}

.bot-group-del-btn:hover {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #EF4444;
  transform: scale(1.1);
}

.bot-group-name-text {
  cursor: text;
}
.bot-group-name-text:hover {
  text-decoration: underline dotted #94A3B8;
}

/* Group Drag Handle and Reordering Styles */
.bot-group-drag-handle {
  cursor: grab;
  color: #94A3B8;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 3px;
  margin-right: 2px;
  border-radius: 3px;
  user-select: none;
  transition: all 0.15s ease;
}

.bot-folder-header:hover .bot-group-drag-handle,
.bot-group-header:hover .bot-group-drag-handle {
  color: #1E293B;
}

.bot-group-drag-handle:active {
  cursor: grabbing;
}

/* While group is being dragged */
.bot-folder-item.is-group-dragging,
.bot-group-section.is-group-dragging {
  opacity: 0.45;
  outline: 2px dashed #2563EB !important;
  border-radius: 6px;
  background: #EFF6FF !important;
}

/* Group drop position indicators */
.bot-folder-item,
.bot-group-section {
  position: relative;
  transition: transform 0.15s ease, background 0.15s ease;
}

.bot-folder-item.group-drag-over-top::before,
.bot-group-section.group-drag-over-top::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  height: 4px;
  background: #2563EB;
  border-radius: 3px;
  z-index: 30;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.75);
}

.bot-folder-item.group-drag-over-bottom::after,
.bot-group-section.group-drag-over-bottom::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 4px;
  background: #2563EB;
  border-radius: 3px;
  z-index: 30;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.75);
}

/* Context Menu: Chuột phải vào Block */
.bot-context-menu {
  position: fixed;
  z-index: 999999;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 5px;
  min-width: 175px;
  display: none;
  font-family: inherit;
  user-select: none;
  animation: botContextMenuFadeIn 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes botContextMenuFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.bot-context-menu-header {
  padding: 6px 10px 5px;
  font-size: 11px;
  font-weight: 700;
  color: #64748B;
  border-bottom: 1px solid #F1F5F9;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.bot-context-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  color: #1E293B;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
}

.bot-context-item:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.bot-context-item.danger {
  color: #DC2626;
}

.bot-context-item.danger:hover {
  background: #FEF2F2;
  color: #B91C1C;
}

.bot-context-divider {
  height: 1px;
  background: #F1F5F9;
  margin: 4px 0;
}

.bot-folder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 6px;
  padding: 2px;
}

.bot-grid-pill {
  padding: 6px 4px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: #334155;
  text-align: center;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.bot-grid-pill:hover {
  background: #EFF6FF;
  border-color: #3B82F6;
  color: #1D4ED8;
  transform: translateY(-1px);
}

.bot-grid-pill.active {
  background: #17234E;
  border-color: #17234E;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(23, 35, 78, 0.3);
}

/* Canvas Viewport */
.bot-map-canvas-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: #F1F5F9;
  background-image: radial-gradient(circle, #CBD5E1 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  cursor: grab;
  user-select: none;
}

.bot-map-canvas-viewport.is-panning {
  cursor: grabbing !important;
}

/* Floating Canvas Toolbar */
.bot-map-toolbar {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 30;
  display: flex;
  gap: 14px;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  padding: 6px 14px;
  border-radius: 30px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid #CBD5E1;
}

.bot-map-toolbar-group {
  display: flex;
  gap: 4px;
  align-items: center;
}

.bot-map-toolbar button {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  cursor: pointer;
  color: #1E293B;
  transition: all 0.15s ease;
}

.bot-map-toolbar button:hover {
  background: #E2E8F0;
  border-color: #94A3B8;
}

.bot-map-style-toggle.active {
  background: #0B6047 !important;
  color: #FFFFFF !important;
  border-color: #0B6047 !important;
}

/* Canvas World Coordinate Space */
.bot-map-world {
  position: absolute;
  top: 0;
  left: 0;
  width: 12000px;
  height: 12000px;
  transform-origin: 0 0;
  will-change: transform;
}

/* SVG Wires Layer */
.bot-map-svg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.bot-wire-group {
  pointer-events: stroke;
  cursor: pointer;
}

.bot-wire-hit {
  stroke: transparent;
  stroke-width: 18px;
  fill: none;
  cursor: pointer;
}

.bot-wire-line {
  stroke: #17234E;
  stroke-width: 2.5px;
  fill: none;
  transition: stroke 0.15s ease, stroke-width 0.15s ease;
}

.bot-wire-group:hover .bot-wire-line,
.bot-wire-group.active .bot-wire-line {
  stroke: #2563EB;
  stroke-width: 4px;
  filter: url(#wireGlow);
}

.bot-temp-wire {
  stroke: #2563EB;
  stroke-width: 2.5px;
  stroke-dasharray: 6 4;
  fill: none;
  animation: wireDash 0.5s linear infinite;
}

@keyframes wireDash {
  to {
    stroke-dashoffset: -10;
  }
}

/* Node Elements on Canvas */
.bot-map-nodes-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.bot-map-node {
  position: absolute;
  width: 220px;
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #CBD5E1;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  z-index: 10;
  cursor: default;
  pointer-events: auto;
}

.bot-map-node:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.bot-map-node.active {
  border-color: #2563EB;
  box-shadow: 0 0 0 2px #2563EB, 0 8px 28px rgba(37, 99, 235, 0.25);
  z-index: 20;
}

@keyframes botBlockSpotlightPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.8), 0 0 25px rgba(37, 99, 235, 0.5);
    transform: scale(1);
  }
  30% {
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0.55), 0 0 40px rgba(37, 99, 235, 0.8);
    transform: scale(1.04);
  }
  60% {
    box-shadow: 0 0 0 16px rgba(37, 99, 235, 0.15), 0 0 25px rgba(37, 99, 235, 0.4);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 3px #2563EB, 0 8px 28px rgba(37, 99, 235, 0.25);
    transform: scale(1);
  }
}

.bot-map-node.spotlight {
  animation: botBlockSpotlightPulse 1.2s cubic-bezier(0.25, 1, 0.5, 1);
  border-color: #2563EB !important;
  z-index: 60 !important;
}

.bot-node-header {
  background: #17234E;
  color: #FFFFFF;
  padding: 8px 10px;
  border-radius: 7px 7px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: move;
}

.bot-node-title {
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.bot-node-stats {
  display: flex;
  gap: 6px;
  font-size: 9.5px;
  color: #94A3B8;
}

.bot-node-edit-btn {
  background: rgba(255, 255, 255, 0.18);
  border: 0;
  border-radius: 4px;
  color: #FFFFFF;
  font-size: 10px;
  padding: 2px 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.bot-node-edit-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.bot-node-collapse-btn {
  background: rgba(255, 255, 255, 0.18);
  border: 0;
  border-radius: 4px;
  color: #FFFFFF;
  font-size: 10px;
  padding: 2px 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.bot-node-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.bot-map-node.collapsed {
  height: auto !important;
}

.bot-map-node.collapsed .bot-node-body {
  display: none !important;
}

.bot-map-node.collapsed .bot-node-header {
  border-radius: 7px;
}

/* Ports & Anchor Connectors */
.node-anchor-in {
  position: absolute;
  left: -7px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10B981;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1px #10B981;
  cursor: pointer;
  z-index: 25;
  transition: transform 0.15s ease, background 0.15s ease;
}

.node-anchor-in:hover,
.node-anchor-in.snap-target {
  transform: scale(1.6);
  background: #059669;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.4);
}

.node-anchor-out {
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2563EB;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1px #2563EB;
  cursor: crosshair;
  z-index: 25;
  transition: transform 0.15s ease, background 0.15s ease;
}

.node-anchor-out:hover {
  transform: translateY(-50%) scale(1.6);
  background: #1D4ED8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4);
}

/* Node Body Content */
.bot-node-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
}

.bot-mini-card {
  padding: 6px 8px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bot-mini-card-badge {
  font-size: 9px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bot-mini-card-text {
  font-size: 10.5px;
  color: #1E293B;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.bot-mini-btn {
  position: relative;
  padding: 5px 8px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  color: #1E293B;
  text-align: left;
  margin-top: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bot-mini-btn:hover {
  background: #EFF6FF;
  border-color: #93C5FD;
}

.bot-mini-btn-badge {
  font-size: 8.5px;
  color: #2563EB;
  background: #DBEAFE;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 700;
}

/* Wire Details Popover */
.bot-wire-tooltip {
  position: absolute;
  z-index: 100;
  background: #1E293B;
  color: #FFFFFF;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
}

.bot-wire-del-btn {
  background: #EF4444;
  color: #FFFFFF;
  border: 0;
  border-radius: 4px;
  font-size: 10px;
  padding: 3px 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s ease;
}

.bot-wire-del-btn:hover {
  background: #DC2626;
}

/* Canvas Footer Info */
.bot-map-canvas-info {
  position: absolute;
  bottom: 12px;
  left: 16px;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid #CBD5E1;
  font-size: 11px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

/* ==========================================================================
   MULTI-BOT DASHBOARD (https://smax.bot/bots layout)
   ========================================================================== */

.botlist-page-view {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  background: #F8FAF9;
  overflow-y: auto;
  overflow-x: auto;
  box-sizing: border-box;
}

.botlist-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  gap: 16px;
  flex-wrap: wrap;
}

.botlist-nav-tabs {
  display: flex;
  gap: 4px;
}

.botlist-nav-tab {
  border: 0;
  background: transparent;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.botlist-nav-tab.active {
  color: #0B6047;
  border-bottom-color: #0B6047;
}

.botlist-nav-tab:hover {
  color: #0B6047;
}

.botlist-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.botlist-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #E8F5EE;
  border: 1px solid #BED8C8;
  border-radius: 20px;
  font-size: 12px;
  color: #0B6047;
}

.botlist-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.botlist-search-wrap input {
  padding: 8px 12px 8px 32px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-size: 13px;
  width: 240px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #FFFFFF;
}

.botlist-search-wrap input:focus {
  border-color: #0B6047;
  box-shadow: 0 0 0 3px rgba(11, 96, 71, 0.12);
}

.botlist-search-wrap .search-icon {
  position: absolute;
  left: 10px;
  color: #94A3B8;
  font-size: 13px;
  pointer-events: none;
}

.botlist-btn-create {
  background: #0B6047;
  color: #FFFFFF;
  border: 0;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 2px 6px rgba(11, 96, 71, 0.25);
}

.botlist-btn-create:hover {
  background: #084c38;
  transform: translateY(-1px);
}

.botlist-subbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  gap: 16px;
  flex-wrap: wrap;
}

.botlist-filter-group {
  display: flex;
  gap: 8px;
}

.botlist-filter-btn {
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  transition: all 0.15s;
}

.botlist-filter-btn.active {
  background: #0B6047;
  color: #FFFFFF;
  border-color: #0B6047;
}

.botlist-subbar-hint {
  font-size: 12px;
  color: #64748B;
}

.botlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  padding: 24px;
}

/* Card: Create New Bot */
.botlist-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  min-height: 240px;
}

.botlist-card:hover {
  border-color: #0B6047;
  box-shadow: 0 8px 24px rgba(11, 96, 71, 0.12);
  transform: translateY(-2px);
}

.botlist-card[draggable="true"] {
  cursor: grab;
  user-select: none;
}

.botlist-card[draggable="true"]:active {
  cursor: grabbing;
}

.bot-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: #94A3B8;
  cursor: grab;
  font-size: 14px;
  font-weight: bold;
  border-radius: 4px;
  margin-right: 6px;
  transition: all 0.15s ease;
}

.bot-drag-handle:hover {
  color: #0B6047;
  background: #E8F5EE;
}

.botlist-card.is-dragging {
  opacity: 0.35 !important;
  border: 2px dashed #0B6047 !important;
  background: #F0FDF4 !important;
  transform: scale(0.97) !important;
  box-shadow: 0 4px 12px rgba(11, 96, 71, 0.15) !important;
}

.botlist-card.drag-over-left {
  border-left: 4px solid #0B6047 !important;
  transform: translateX(4px);
}

.botlist-card.drag-over-right {
  border-right: 4px solid #0B6047 !important;
  transform: translateX(-4px);
}

/* Drag and Drop for Cards in Block Canvas Stack */
.bot-card[draggable="true"] {
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.bot-card-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #94A3B8;
  cursor: grab;
  font-size: 13px;
  margin-right: 6px;
  border-radius: 3px;
  transition: all 0.15s ease;
}

.bot-card-drag-handle:hover {
  color: #0B6047;
  background: #E8F5EE;
}

.bot-card.is-card-dragging {
  opacity: 0.35 !important;
  border: 2px dashed #0B6047 !important;
  background: #F0FDF4 !important;
}

.bot-card.card-drag-over-top {
  border-top: 3px solid #0B6047 !important;
}

.bot-card.card-drag-over-bottom {
  border-bottom: 3px solid #0B6047 !important;
}

/* Drag and Drop for Blocks in Tree Sidebar */
.bot-block-item[draggable="true"] {
  cursor: grab;
}

.bot-block-item[draggable="true"]:active {
  cursor: grabbing;
}

.bot-block-item.is-block-dragging {
  opacity: 0.4 !important;
  background: #E8F5EE !important;
  border: 1px dashed #0B6047 !important;
}

.bot-block-item.block-drag-over-top {
  border-top: 2px solid #0B6047 !important;
}

.bot-block-item.block-drag-over-bottom {
  border-bottom: 2px solid #0B6047 !important;
}

.bot-group-section.group-drag-over {
  background: #F0FDF4 !important;
  outline: 2px dashed #0B6047 !important;
}

.botlist-card--new {
  border: 2px dashed #CBD5E1;
  background: #F8FAFC;
  text-align: center;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.botlist-card--new:hover {
  border-color: #0B6047;
  background: #F0FDF4;
}

.new-bot-plus-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #E8F5EE;
  color: #0B6047;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: bold;
  margin-bottom: 6px;
  transition: transform 0.2s;
}

.botlist-card--new:hover .new-bot-plus-icon {
  transform: scale(1.1);
}

.new-bot-title {
  font-size: 16px;
  font-weight: 700;
  color: #1E293B;
  margin: 0;
}

.new-bot-desc {
  font-size: 12px;
  color: #64748B;
  max-width: 220px;
  margin: 0;
  line-height: 1.4;
}

/* Normal Bot Card */
.botlist-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.botlist-members {
  display: flex;
  align-items: center;
}

.bot-member-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  background: #E2E8F0;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: -6px;
}

.bot-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bot-star-btn {
  background: transparent;
  border: 0;
  font-size: 18px;
  cursor: pointer;
  color: #CBD5E1;
  transition: color 0.15s, transform 0.1s;
  padding: 0 4px;
}

.bot-star-btn:hover {
  transform: scale(1.15);
}

.bot-star-btn.starred {
  color: #EAB308;
}

.bot-options-btn {
  background: transparent;
  border: 0;
  font-size: 18px;
  cursor: pointer;
  color: #94A3B8;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}

.bot-options-btn:hover {
  background: #F1F5F9;
  color: #1E293B;
}

.botlist-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4px 0 14px;
}

.bot-avatar-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E8F5EE, #D1EADE);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 10px;
  border: 2px solid #BED8C8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  position: relative;
}

.bot-avatar-platform {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1877F2;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
}

.bot-title {
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 6px;
  line-height: 1.3;
}

.bot-page-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #0284C7;
  font-weight: 500;
  background: #F0F9FF;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #BAE6FD;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-page-link.unlinked {
  color: #94A3B8;
  background: #F8FAFC;
  border-color: #E2E8F0;
}

.botlist-card-footer {
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid #F1F5F9;
  padding-top: 12px;
  margin-top: auto;
}

.stat-col {
  text-align: center;
}

.stat-col .stat-num {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
}

.stat-col .stat-label {
  display: block;
  font-size: 11px;
  color: #64748B;
}

/* Studio Header & Back Button */
.bot-back-to-list-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #1E293B;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.bot-back-to-list-btn:hover {
  background: #E8F5EE;
  border-color: #0B6047;
  color: #0B6047;
}

.bot-header-divider {
  width: 1px;
  height: 32px;
  background: #E2E8F0;
  margin: 0 10px;
}

.bot-current-identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bot-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bot-title-line h1 {
  font-size: 16px;
  font-weight: 700;
  color: #1E293B;
  margin: 0;
}

.bot-current-avatar {
  font-size: 18px;
}

.bot-current-badge {
  background: #E8F5EE;
  color: #0B6047;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #BED8C8;
}

.bot-page-link-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #64748B;
}

.bot-page-dropdown {
  font-size: 11px;
  font-weight: 600;
  color: #0B6047;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  padding: 2px 8px;
  background: #FFFFFF;
  cursor: pointer;
  outline: none;
}

.bot-page-dropdown:focus {
  border-color: #0B6047;
}

/* Template Radio options in create modal */
.bot-tpl-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bot-tpl-radio {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  background: #FFFFFF;
}

.bot-tpl-radio:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
}

.bot-tpl-radio.active {
  border-color: #0B6047;
  background: #F0FDF4;
}

.bot-tpl-radio input[type="radio"] {
  margin-top: 3px;
  accent-color: #0B6047;
}

.bot-tpl-radio strong {
  display: block;
  font-size: 13px;
  color: #1E293B;
  margin-bottom: 2px;
}

.bot-tpl-radio small {
  display: block;
  font-size: 11px;
  color: #64748B;
  line-height: 1.4;
}

/* Pages table view */
.botlist-pages-view {
  padding: 24px;
}

.botlist-pages-header h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: #1E293B;
}

.botlist-pages-header p {
  margin: 0 0 16px;
  font-size: 13px;
  color: #64748B;
}

.botlist-pages-table-wrap {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

.botlist-pages-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 13px;
}

.botlist-pages-table th {
  background: #F8FAFC;
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid #E2E8F0;
}

.botlist-pages-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
  white-space: nowrap;
}

.botlist-pages-table tr:hover td {
  background: #F8FAF9;
}

/* News View */
.botlist-news-view {
  padding: 24px;
}

.botlist-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.botlist-news-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.botlist-news-card .news-tag {
  align-self: flex-start;
  padding: 3px 8px;
  background: #E8F5EE;
  color: #0B6047;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
}

.botlist-news-card h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.4;
}

.botlist-news-card p {
  margin: 0;
  font-size: 12px;
  color: #64748B;
  line-height: 1.5;
}

.botlist-news-card .news-date {
  font-size: 11px;
  color: #94A3B8;
  margin-top: auto;
}

/* --- UNIFIED VISIBLE CUSTOM HORIZONTAL & VERTICAL SCROLLBARS FOR ALL 3 BOT INTERFACES --- */
.bot-auto-view::-webkit-scrollbar,
.bot-mode-page-container::-webkit-scrollbar,
#botRuleContainer::-webkit-scrollbar,
.botlist-page-view::-webkit-scrollbar,
.botlist-pages-table-wrap::-webkit-scrollbar,
.bot-studio-page::-webkit-scrollbar,
.bot-canvas-area::-webkit-scrollbar,
.bot-blocks-tree::-webkit-scrollbar,
.bot-simulator-pane::-webkit-scrollbar,
.bot-map-folders-list::-webkit-scrollbar,
.bot-phone-messages::-webkit-scrollbar,
.bot-sim-attr-box::-webkit-scrollbar,
.bot-keywords-layout::-webkit-scrollbar,
.bot-page-container::-webkit-scrollbar,
.bot-table-card::-webkit-scrollbar,
.bot-smax-leftbar::-webkit-scrollbar,
.bot-ai-page-view::-webkit-scrollbar,
#botAiPage::-webkit-scrollbar,
.bot-ai-chat-thread::-webkit-scrollbar,
.bot-ai-quick-prompts::-webkit-scrollbar,
.bot-ai-nav-tabs::-webkit-scrollbar,
.bot-hybrid-page-view::-webkit-scrollbar,
#botHybridPage::-webkit-scrollbar,
.hybrid-pipeline-steps::-webkit-scrollbar,
.hybrid-table-wrap::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.bot-auto-view::-webkit-scrollbar-track,
.bot-mode-page-container::-webkit-scrollbar-track,
#botRuleContainer::-webkit-scrollbar-track,
.botlist-page-view::-webkit-scrollbar-track,
.botlist-pages-table-wrap::-webkit-scrollbar-track,
.bot-studio-page::-webkit-scrollbar-track,
.bot-canvas-area::-webkit-scrollbar-track,
.bot-blocks-tree::-webkit-scrollbar-track,
.bot-simulator-pane::-webkit-scrollbar-track,
.bot-map-folders-list::-webkit-scrollbar-track,
.bot-phone-messages::-webkit-scrollbar-track,
.bot-sim-attr-box::-webkit-scrollbar-track,
.bot-keywords-layout::-webkit-scrollbar-track,
.bot-page-container::-webkit-scrollbar-track,
.bot-table-card::-webkit-scrollbar-track,
.bot-smax-leftbar::-webkit-scrollbar-track,
.bot-ai-page-view::-webkit-scrollbar-track,
#botAiPage::-webkit-scrollbar-track,
.bot-ai-chat-thread::-webkit-scrollbar-track,
.bot-ai-quick-prompts::-webkit-scrollbar-track,
.bot-ai-nav-tabs::-webkit-scrollbar-track,
.bot-hybrid-page-view::-webkit-scrollbar-track,
#botHybridPage::-webkit-scrollbar-track,
.hybrid-pipeline-steps::-webkit-scrollbar-track,
.hybrid-table-wrap::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 5px;
}

.bot-auto-view::-webkit-scrollbar-thumb,
.bot-mode-page-container::-webkit-scrollbar-thumb,
#botRuleContainer::-webkit-scrollbar-thumb,
.botlist-page-view::-webkit-scrollbar-thumb,
.botlist-pages-table-wrap::-webkit-scrollbar-thumb,
.bot-studio-page::-webkit-scrollbar-thumb,
.bot-canvas-area::-webkit-scrollbar-thumb,
.bot-blocks-tree::-webkit-scrollbar-thumb,
.bot-simulator-pane::-webkit-scrollbar-thumb,
.bot-map-folders-list::-webkit-scrollbar-thumb,
.bot-phone-messages::-webkit-scrollbar-thumb,
.bot-sim-attr-box::-webkit-scrollbar-thumb,
.bot-keywords-layout::-webkit-scrollbar-thumb,
.bot-page-container::-webkit-scrollbar-thumb,
.bot-table-card::-webkit-scrollbar-thumb,
.bot-smax-leftbar::-webkit-scrollbar-thumb,
.bot-ai-page-view::-webkit-scrollbar-thumb,
#botAiPage::-webkit-scrollbar-thumb,
.bot-ai-chat-thread::-webkit-scrollbar-thumb,
.bot-ai-quick-prompts::-webkit-scrollbar-thumb,
.bot-ai-nav-tabs::-webkit-scrollbar-thumb,
.bot-hybrid-page-view::-webkit-scrollbar-thumb,
#botHybridPage::-webkit-scrollbar-thumb,
.hybrid-pipeline-steps::-webkit-scrollbar-thumb,
.hybrid-table-wrap::-webkit-scrollbar-thumb {
  background: #88A393;
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.bot-auto-view::-webkit-scrollbar-thumb:hover,
.bot-mode-page-container::-webkit-scrollbar-thumb:hover,
#botRuleContainer::-webkit-scrollbar-thumb:hover,
.botlist-page-view::-webkit-scrollbar-thumb:hover,
.botlist-pages-table-wrap::-webkit-scrollbar-thumb:hover,
.bot-studio-page::-webkit-scrollbar-thumb:hover,
.bot-canvas-area::-webkit-scrollbar-thumb:hover,
.bot-blocks-tree::-webkit-scrollbar-thumb:hover,
.bot-simulator-pane::-webkit-scrollbar-thumb:hover,
.bot-map-folders-list::-webkit-scrollbar-thumb:hover,
.bot-phone-messages::-webkit-scrollbar-thumb:hover,
.bot-sim-attr-box::-webkit-scrollbar-thumb:hover,
.bot-keywords-layout::-webkit-scrollbar-thumb:hover,
.bot-page-container::-webkit-scrollbar-thumb:hover,
.bot-table-card::-webkit-scrollbar-thumb:hover,
.bot-smax-leftbar::-webkit-scrollbar-thumb:hover,
.bot-ai-page-view::-webkit-scrollbar-thumb:hover,
#botAiPage::-webkit-scrollbar-thumb:hover,
.bot-ai-chat-thread::-webkit-scrollbar-thumb:hover,
.bot-ai-quick-prompts::-webkit-scrollbar-thumb:hover,
.bot-ai-nav-tabs::-webkit-scrollbar-thumb:hover,
.bot-hybrid-page-view::-webkit-scrollbar-thumb:hover,
#botHybridPage::-webkit-scrollbar-thumb:hover,
.hybrid-pipeline-steps::-webkit-scrollbar-thumb:hover,
.hybrid-table-wrap::-webkit-scrollbar-thumb:hover {
  background: #0B6047;
}

.bot-auto-view::-webkit-scrollbar-corner,
.bot-mode-page-container::-webkit-scrollbar-corner,
.bot-ai-page-view::-webkit-scrollbar-corner,
.bot-hybrid-page-view::-webkit-scrollbar-corner,
.bot-canvas-area::-webkit-scrollbar-corner,
.botlist-page-view::-webkit-scrollbar-corner,
.bot-page-container::-webkit-scrollbar-corner {
  background: transparent;
}

/* Firefox standard scrollbars */
.bot-canvas-area,
.bot-blocks-tree,
.bot-simulator-pane,
.bot-phone-messages,
.bot-map-folders-list,
.bot-auto-view,
.bot-mode-page-container,
.botlist-page-view,
.botlist-pages-table-wrap,
.bot-page-container,
.bot-table-card,
.bot-ai-page-view,
.bot-hybrid-page-view,
.bot-ai-chat-thread,
.bot-ai-quick-prompts,
.bot-ai-nav-tabs,
.hybrid-pipeline-steps,
.hybrid-table-wrap {
  scrollbar-width: thin;
  scrollbar-color: #88A393 rgba(0, 0, 0, 0.05);
}

/* Smax Go To Block Card Styling */
.smax-goto-card-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.smax-goto-filter-box {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 14px 16px;
  background: #fbfcfd;
}

.smax-goto-filter-hint {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.smax-goto-add-filter-link {
  background: transparent;
  border: none;
  color: #2563eb;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.smax-goto-add-filter-link:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

.smax-goto-filter-rows-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.smax-filter-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}

.smax-filter-col-type {
  width: 120px;
  flex-shrink: 0;
}

.smax-filter-col-attr {
  width: 175px;
  flex-shrink: 0;
}

.smax-filter-col-op {
  width: 80px;
  flex-shrink: 0;
}

.smax-filter-col-val {
  width: 100px;
  flex-shrink: 0;
}

.smax-filter-col-del {
  width: 32px;
  flex-shrink: 0;
}

.smax-filter-col-type select,
.smax-filter-col-op select {
  width: 100%;
  height: 38px;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2364748b' d='M0 0l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 10px center;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 24px 0 10px;
  font-size: 13px;
  color: #1e293b;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease;
}

.smax-filter-col-val input {
  width: 100%;
  height: 38px;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2364748b' d='M0 0l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 24px 0 10px;
  font-size: 13px;
  color: #1e293b;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease;
}

.smax-filter-col-type select:focus,
.smax-filter-col-op select:focus,
.smax-filter-col-val input:focus {
  border-color: #3b82f6;
  background-color: #fff;
}

.smax-attr-pill {
  height: 38px;
  background: #52525b;
  border-radius: 20px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 2px;
  box-sizing: border-box;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.smax-attr-bracket {
  color: #fef08a;
  font-weight: 700;
  font-size: 12.5px;
  user-select: none;
}

.smax-filter-attr-input {
  background: transparent;
  border: none;
  color: #ffffff;
  font-weight: 600;
  font-size: 12px;
  width: 100%;
  outline: none;
  padding: 0 2px;
}

.smax-pill-arrow {
  font-size: 9px;
  color: #d4d4d8;
  margin-left: 2px;
  pointer-events: none;
}

.smax-filter-del-btn {
  width: 34px;
  height: 38px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #94a3b8;
  font-size: 14px;
  transition: all 0.15s ease;
}

.smax-filter-del-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #ef4444;
}

.smax-goto-add-new-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s;
}

.smax-goto-add-new-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.smax-goto-target-box {
  margin-top: 4px;
}

.smax-goto-target-label {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 8px;
  display: block;
}

.smax-goto-target-select {
  width: 100%;
  height: 42px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.smax-goto-target-select:focus {
  border-color: #3b82f6;
  background: #fff;
}

.smax-goto-random-wrap {
  margin-top: 10px;
}

.smax-goto-random-btn {
  background: transparent;
  border: none;
  color: #1e293b;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.smax-goto-random-btn:hover {
  color: #2563eb;
}

.bot-card-type-badge.goto_block {
  background: transparent;
  color: #0f172a;
  border: none;
  font-weight: 700;
  font-size: 15px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bot-card-type-badge.goto_block::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 28px;
  background: #ede9fe url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3v12a3 3 0 003 3h9m0 0l-3-3m3 3l-3 3'/%3E%3C/svg%3E") no-repeat center;
  border-radius: 6px;
}

/* ==========================================================================
   SMAX ENTERPRISE MODULES: AUDIENCE, SEQUENCES, BROADCASTS, ADS, ANALYTICS,
   INTEGRATIONS, TOOLS, LOGS, AND SETTINGS
   ========================================================================== */

.bot-tab-pane {
  display: none;
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.bot-tab-pane.active {
  display: flex;
  flex-direction: column;
}

.bot-page-container {
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: auto !important;
  padding: 16px 20px 80px;
  box-sizing: border-box;
  background: #F8FAFC;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bot-page-container > * {
  flex-shrink: 0;
}

.bot-page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-shrink: 0;
}

.bot-page-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bot-page-sub {
  margin: 0;
  font-size: 11.5px;
  color: #536B5B;
  line-height: 1.45;
}

.bot-page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* KPI Cards Grid */
.bot-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.bot-kpi-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.bot-kpi-icon {
  font-size: 22px;
  line-height: 1;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #F1F5F9;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.bot-kpi-info {
  display: flex;
  flex-direction: column;
}

.bot-kpi-num {
  font-size: 20px;
  font-weight: 700;
  color: #0F172A;
}

.bot-kpi-label {
  font-size: 11px;
  color: #64748B;
  margin-top: 2px;
}

/* Filter Bar & Controls */
.bot-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bot-filter-select {
  padding: 7px 12px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-size: 12px;
  background: #FFFFFF;
  color: #1E293B;
  outline: none;
  cursor: pointer;
}

.bot-filter-select:focus {
  border-color: #0B6047;
  box-shadow: 0 0 0 2px rgba(11, 96, 71, 0.15);
}

.bot-text-input {
  padding: 8px 12px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-size: 12px;
  background: #FFFFFF;
  color: #0F172A;
  outline: none;
  box-sizing: border-box;
}

.bot-text-input:focus {
  border-color: #0B6047;
  box-shadow: 0 0 0 2px rgba(11, 96, 71, 0.15);
}

.bot-field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 5px;
}

/* Data Table */
.bot-table-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.bot-data-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.bot-data-table th {
  background: #F8FAFC;
  color: #475569;
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid #E2E8F0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.bot-data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
  color: #334155;
}

.bot-data-table tr:hover td {
  background: #F8FAFC;
}

/* Badges & Tags */
.bot-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
}

.bot-badge--tag {
  background: #EBF3FE;
  color: #2563EB;
  border: 1px solid #BFDBFE;
}

.bot-badge--attr {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.bot-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 600;
}

/* Card Panel & Dual Column */
.bot-card-panel {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.bot-panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bot-dual-column-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .bot-dual-column-layout {
    grid-template-columns: 1fr;
  }
}

/* Sequences Drip Stack */
.bot-sequences-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bot-seq-group-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.bot-seq-group-header {
  padding: 14px 18px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bot-seq-steps-list {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bot-seq-step-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
}

.bot-seq-step-delay {
  padding: 4px 10px;
  background: #E2ECE5;
  color: #0B6047;
  font-weight: 700;
  font-size: 11px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Tools Grid */
.bot-tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .bot-tools-grid {
    grid-template-columns: 1fr;
  }
}

.bot-tool-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.bot-tool-badge {
  padding: 2px 7px;
  background: #E6F7ED;
  color: #0B6047;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
}

.bot-health-report {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
}

/* Integrations Grid */
.bot-integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.bot-integration-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bot-integration-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Log Category Tabs */
.bot-log-category-tabs {
  display: flex;
  background: #E2ECE5;
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
  width: fit-content;
}

.bot-log-cat-tab {
  border: 0;
  background: transparent;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #536B5B;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bot-log-cat-tab:hover {
  color: #0F172A;
}

.bot-log-cat-tab.active {
  background: #FFFFFF;
  color: #0B6047;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Conversion Funnel Display */
.bot-funnel-display {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bot-funnel-step {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bot-funnel-bar-bg {
  width: 100%;
  height: 28px;
  background: #F1F5F9;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 10px;
  box-sizing: border-box;
}

.bot-funnel-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #0B6047, #10B981);
  border-radius: 6px;
  opacity: 0.85;
  transition: width 0.4s ease;
}

.bot-funnel-label {
  position: relative;
  z-index: 2;
  font-size: 11.5px;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.bot-funnel-val {
  position: relative;
  z-index: 2;
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.bot-json-preview-box {
  background: #1E293B;
  border-radius: 8px;
  padding: 14px;
  max-height: 280px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 11.5px;
  color: #E2E8F0;
  line-height: 1.5;
}

/* ==========================================================================
   BOT-AUTO TOP MODE SWITCHER BAR: BOT KỊCH BẢN VS BOT AI VS HYBRID
   ========================================================================== */
.bot-mode-switcher-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  position: sticky;
  top: 0;
  z-index: 40;
}

.bot-mode-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bot-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  cursor: pointer;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.bot-mode-tab:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.bot-mode-tab.active {
  background: #0B6047;
  color: #FFFFFF;
  border-color: #0B6047;
  box-shadow: 0 2px 6px rgba(11, 96, 71, 0.25);
}

.bot-mode-tab .mode-icon {
  font-size: 15px;
}

.bot-mode-tab .mode-badge {
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
}

.bot-mode-tab.active .mode-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.bot-mode-tab .ai-badge {
  background: #FEF3C7;
  color: #92400E;
}

.bot-mode-tab.active .ai-badge {
  background: #F59E0B;
  color: #FFFFFF;
}

.bot-mode-tab .hybrid-badge {
  background: #E0E7FF;
  color: #3730A3;
}

.bot-mode-tab.active .hybrid-badge {
  background: #6366F1;
  color: #FFFFFF;
}

.bot-mode-status-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #334155;
  background: #F8FAFC;
  padding: 6px 12px;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.bot-mode-status-tag.is-custom {
  background: #F0FDF4;
  border-color: #86EFAC;
}

.bot-mode-status-tag.is-paused {
  background: #FEF2F2;
  border-color: #FECACA;
}

.bot-mode-status-tag.is-paused .status-pulse {
  background: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
  animation: none;
}

.custom-channel-badge {
  background: #DCFCE7;
  color: #15803D;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid #BBF7D0;
  display: inline-block;
}

.status-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* BOT-AUTO TOPBAR ACTIONS & OPERATING CONTROLS */
.bot-mode-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 1. Master Bot Power Toggle Button */
.bot-master-power-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  user-select: none;
  font-family: inherit;
}

.bot-master-power-btn.enabled {
  background: #ECFDF5;
  color: #065F46;
  border-color: #A7F3D0;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.15);
}

.bot-master-power-btn.enabled:hover {
  background: #D1FAE5;
  border-color: #6EE7B7;
}

.bot-master-power-btn.disabled {
  background: #FEF2F2;
  color: #991B1B;
  border-color: #FECACA;
}

.bot-master-power-btn.disabled:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
}

.bot-master-power-btn .power-dot {
  font-size: 13px;
  line-height: 1;
  display: inline-block;
}

.bot-master-power-btn.enabled .power-dot {
  color: #10B981;
  animation: power-pulse 2s infinite;
}

.bot-master-power-btn.disabled .power-dot {
  color: #EF4444;
}

@keyframes power-pulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 1px #10B981); }
  50% { transform: scale(1.25); filter: drop-shadow(0 0 3px #10B981); }
  100% { transform: scale(1); filter: drop-shadow(0 0 1px #10B981); }
}

/* 2. Global Operating Scheme Segmented Pill Selector */
.bot-scheme-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #F8FAFC;
  padding: 3px 6px;
  border: 1px solid #E2E8F0;
  border-radius: 9px;
}

.bot-scheme-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748B;
  padding-left: 4px;
}

.bot-scheme-pills {
  display: flex;
  align-items: center;
  gap: 3px;
}

.scheme-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  font-family: inherit;
}

.scheme-pill-btn:hover {
  background: #F1F5F9;
  color: #0F172A;
}

/* Active Schemes */
.scheme-pill-btn.active[data-scheme="rule"] {
  background: #EFF6FF;
  color: #1D4ED8;
  border-color: #BFDBFE;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.1);
}

.scheme-pill-btn.active[data-scheme="ai"] {
  background: #F5F3FF;
  color: #6D28D9;
  border-color: #DDD6FE;
  box-shadow: 0 1px 2px rgba(109, 40, 217, 0.1);
}

.scheme-pill-btn.active[data-scheme="hybrid"] {
  background: #0B6047;
  color: #FFFFFF;
  border-color: #0B6047;
  box-shadow: 0 2px 4px rgba(11, 96, 71, 0.22);
}

.scheme-badge-rec {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  text-transform: uppercase;
}

.scheme-pill-btn:not(.active) .scheme-badge-rec {
  background: #FEF3C7;
  color: #B45309;
}

/* ==========================================================================
   BOT OPERATING MODE CONTAINERS & BOT AI DASHBOARD
   ========================================================================== */
.bot-mode-page-container {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  box-sizing: border-box;
}

#botRuleContainer {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.bot-ai-page-view {
  display: block;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: auto;
  padding: 24px 32px;
  background: #F8FAFC;
  box-sizing: border-box;
}

.bot-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  background: #FFFFFF;
  padding: 16px 24px;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.bot-ai-breadcrumb {
  font-size: 11px;
  font-weight: 700;
  color: #64748B;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.bot-ai-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 4px;
}

.bot-ai-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #0F172A;
}

.bot-ai-desc {
  font-size: 13px;
  color: #64748B;
}

.bot-ai-controls-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bot-ai-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: #475569;
  user-select: none;
}

.bot-ai-switch-label input[type="checkbox"] {
  display: none;
}

.switch-ui {
  position: relative;
  width: 36px;
  height: 20px;
  background: #CBD5E1;
  border-radius: 20px;
  transition: background 0.2s ease;
}

.switch-ui::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #FFFFFF;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.bot-ai-switch-label input:checked + .switch-ui {
  background: #0B6047;
}

.bot-ai-switch-label input:checked + .switch-ui::after {
  transform: translateX(16px);
}

.bot-ai-conn-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #F0FDF4;
  color: #166534;
  border: 1px solid #BBF7D0;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.conn-dot {
  width: 7px;
  height: 7px;
  background: #16A34A;
  border-radius: 50%;
}

.bot-ai-master-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid #E2E8F0;
}

.master-label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.bot-ai-master-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.bot-ai-master-btn.off {
  background: #F1F5F9;
  color: #64748B;
  border-color: #CBD5E1;
}

.bot-ai-master-btn.on {
  background: #0B6047;
  color: #FFFFFF;
  border-color: #0B6047;
}

.bot-ai-refresh-btn {
  background: transparent;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748B;
  transition: background 0.15s ease;
}

.bot-ai-refresh-btn:hover {
  background: #F1F5F9;
  color: #0F172A;
}

/* 7 AI Agents & API Subtabs */
.bot-ai-nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.bot-ai-nav-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.bot-ai-nav-tab:hover {
  border-color: #CBD5E1;
  background: #F8FAFC;
  color: #0F172A;
}

.bot-ai-nav-tab.active {
  background: #0B6047;
  color: #FFFFFF;
  border-color: #0B6047;
  box-shadow: 0 2px 6px rgba(11, 96, 71, 0.2);
}

.tab-status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.tab-status-pill.pill-draft {
  background: #E8F5EE;
  color: #0B6047;
}

.bot-ai-nav-tab.active .tab-status-pill.pill-draft {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.tab-status-pill.pill-off {
  background: #F1F5F9;
  color: #94A3B8;
}

.bot-ai-nav-tab.active .tab-status-pill.pill-off {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

/* 4 Stat Cards in a row */
.bot-ai-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.bot-ai-stat-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.bot-ai-stat-card .stat-header {
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  margin-bottom: 8px;
}

.bot-ai-stat-card .stat-main {
  font-size: 24px;
  font-weight: 800;
  color: #0F172A;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.bot-ai-stat-card .stat-main .cost-val {
  color: #0F172A;
}

.bot-ai-stat-card .stat-main .cost-limit {
  font-size: 15px;
  font-weight: 500;
  color: #94A3B8;
}

.bot-ai-stat-card .stat-sub {
  font-size: 11.5px;
  color: #64748B;
  margin-top: 6px;
}

/* Main 2-Column Workspace for AI Sale */
.bot-ai-sale-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.bot-ai-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.bot-ai-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #F1F5F9;
  background: #FFFFFF;
}

.bot-ai-card-header .card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
}

.card-badge-lock {
  font-size: 11px;
  color: #64748B;
  background: #F1F5F9;
  padding: 3px 8px;
  border-radius: 4px;
}

.card-badge-sub {
  font-size: 11px;
  color: #64748B;
}

.bot-ai-card-body {
  padding: 20px;
}

.bot-ai-field-group {
  margin-bottom: 16px;
}

.bot-ai-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.bot-ai-label .label-hint {
  font-weight: 400;
  color: #64748B;
}

.bot-ai-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #F8FAFC;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
}

.bot-ai-checkbox-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #1E293B;
  cursor: pointer;
  user-select: none;
}

.bot-ai-checkbox-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #0B6047;
  cursor: pointer;
}

.bot-ai-form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.bot-ai-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-size: 13px;
  color: #0F172A;
  box-sizing: border-box;
  background: #FFFFFF;
  transition: border-color 0.15s ease;
}

.bot-ai-input:focus {
  outline: none;
  border-color: #0B6047;
  box-shadow: 0 0 0 3px rgba(11, 96, 71, 0.1);
}

.bot-ai-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: #0F172A;
  box-sizing: border-box;
  resize: vertical;
  font-family: inherit;
  background: #FFFFFF;
  transition: border-color 0.15s ease;
}

.bot-ai-textarea:focus {
  outline: none;
  border-color: #0B6047;
  box-shadow: 0 0 0 3px rgba(11, 96, 71, 0.1);
}

.bot-ai-actions-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.bot-ai-btn-primary {
  padding: 9px 18px;
  background: #0B6047;
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.bot-ai-btn-primary:hover {
  background: #084936;
}

.bot-ai-btn-secondary {
  padding: 9px 14px;
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bot-ai-btn-secondary:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.bot-ai-card-footnote {
  margin-top: 16px;
  padding: 10px 14px;
  background: #FFFBEB;
  border-left: 3px solid #F59E0B;
  border-radius: 0 6px 6px 0;
  font-size: 11.5px;
  color: #78350F;
  line-height: 1.5;
}

/* Simulator Chat Window */
.bot-ai-simulator-card {
  display: flex;
  flex-direction: column;
  height: 600px;
}

.bot-ai-simulator-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background: #F8FAFC;
}

.bot-ai-chat-thread {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-bubble-row {
  display: flex;
  gap: 8px;
  max-width: 82%;
}

.ai-bubble-row.customer {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-bubble-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.ai-bubble-row.assistant .ai-bubble-avatar {
  background: #0B6047;
  color: #FFFFFF;
}

.ai-bubble-content {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ai-bubble-row.assistant .ai-bubble-content {
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #E2E8F0;
  border-top-left-radius: 2px;
  white-space: pre-wrap;
}

.ai-bubble-row.customer .ai-bubble-content {
  background: #0284C7;
  color: #FFFFFF;
  border-top-right-radius: 2px;
}

.ai-order-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #DCFCE7;
  color: #15803D;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 6px;
}

.bot-ai-quick-prompts {
  padding: 8px 14px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.prompts-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748B;
  white-space: nowrap;
}

.bot-ai-chip {
  padding: 4px 10px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  font-size: 11px;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.bot-ai-chip:hover {
  background: #E0F2FE;
  color: #0369A1;
  border-color: #BAE6FD;
}

.bot-ai-chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
}

.bot-ai-chat-input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid #CBD5E1;
  border-radius: 20px;
  font-size: 13px;
  color: #0F172A;
  box-sizing: border-box;
}

.bot-ai-chat-input:focus {
  outline: none;
  border-color: #0B6047;
}

.bot-ai-chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0B6047;
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.bot-ai-chat-send-btn:hover {
  background: #084936;
}

/* ==========================================================================
   HYBRID PIPELINE & COORDINATION VIEW
   ========================================================================== */
.bot-hybrid-page-view {
  display: block;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: auto;
  padding: 24px 32px;
  background: #F8FAFC;
  box-sizing: border-box;
}

.bot-ai-badge-recommended {
  background: #FEF3C7;
  color: #92400E;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #FDE68A;
}

.hybrid-pipeline-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 24px;
}

.pipeline-title {
  margin: 0 0 20px;
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
}

.hybrid-pipeline-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.pipeline-step {
  flex: 1;
  min-width: 170px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 16px 14px;
  text-align: center;
  position: relative;
}

.step-num {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0F172A;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 4px;
  margin-bottom: 8px;
}

.step-badge.rule { background: #E0E7FF; color: #3730A3; }
.step-badge.ai { background: #D1FAE5; color: #065F46; }
.step-badge.audit { background: #FEF3C7; color: #92400E; }
.step-badge.human { background: #FEE2E2; color: #991B1B; }
.step-badge.care { background: #FCE7F3; color: #9D174D; }

.step-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
}

.step-desc {
  margin: 0;
  font-size: 11.5px;
  color: #64748B;
  line-height: 1.45;
}

.pipeline-arrow {
  color: #94A3B8;
  font-size: 18px;
  font-weight: bold;
}

.hybrid-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
}

.hybrid-page-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.hybrid-page-table th {
  background: #F8FAFC;
  padding: 12px 18px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid #E2E8F0;
}

.hybrid-page-table td {
  padding: 16px 18px;
  border-bottom: 1px solid #F1F5F9;
  font-size: 13px;
}

.mode-radio-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mode-radio-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
}

.mode-radio-opt.selected {
  color: #0B6047;
  font-weight: 700;
}

.badge-tag {
  display: inline-block;
  padding: 4px 8px;
  background: #E8F5EE;
  color: #0B6047;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-tag.gray {
  background: #F1F5F9;
  color: #64748B;
}

.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.status-pill.active {
  background: #DCFCE7;
  color: #166534;
}

.status-pill.default {
  background: #F1F5F9;
  color: #475569;
}

/* ==========================================================================
   BOT AI & HYBRID: API CONNECTION SECTION & INTEGRATION BRIDGES
   ========================================================================== */
.bot-ai-api-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  color: #1E293B;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.bot-ai-api-btn:hover {
  background: #F8FAFC;
  border-color: #0B6047;
  color: #0B6047;
}

.bot-ai-api-btn .btn-api-icon {
  font-size: 14px;
}

.api-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  background: #E2E8F0;
  color: #475569;
}

.api-status-badge.active {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

/* API Config Grid */
.api-config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .api-config-grid {
    grid-template-columns: 1fr;
  }
}

.api-config-section {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 18px 20px;
}

.api-sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #F1F5F9;
}

.api-sec-title h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
}

.api-sec-icon {
  font-size: 18px;
}

.api-card-header-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #065F46;
  background: #ECFDF5;
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid #A7F3D0;
}

/* Test Connection Box */
.api-test-box {
  margin-top: 16px;
  padding: 12px 14px;
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.api-test-result {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
}

.api-test-result.success {
  background: #ECFDF5;
  color: #065F46;
  border-color: #A7F3D0;
}

.api-test-result.error {
  background: #FEF2F2;
  color: #991B1B;
  border-color: #FECACA;
}

.api-test-dot {
  font-size: 12px;
}

.api-test-result.success .api-test-dot {
  color: #10B981;
}

.api-test-result.error .api-test-dot {
  color: #EF4444;
}

/* Hybrid API Bridges Card */
.hybrid-api-bridges-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 20px 24px;
  margin-top: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.bridges-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.bridges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 900px) {
  .bridges-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.bridge-item {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px 16px;
  transition: all 0.2s ease;
}

.bridge-item:hover {
  background: #FFFFFF;
  border-color: #0B6047;
  box-shadow: 0 2px 6px rgba(11, 96, 71, 0.1);
}

.bridge-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.bridge-icon {
  font-size: 20px;
}

.bridge-status-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.bridge-status-pill.connected {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.bridge-name {
  margin: 0 0 4px;
  font-size: 13.5px;
  font-weight: 700;
  color: #0F172A;
}

.bridge-meta {
  font-size: 12px;
  color: #475569;
  margin-bottom: 8px;
}

.bridge-latency {
  font-size: 11px;
  color: #64748B;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bridge-latency code {
  background: #FFFFFF;
  padding: 1px 4px;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  font-size: 10.5px;
  color: #0F172A;
}

/* ==========================================================================
   Collapse / Expand All Groups Feature ("Thu / Mở")
   ========================================================================== */
.bot-btn-toggle-collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}

.bot-btn-toggle-collapse:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
  color: #0F172A;
}

.bot-btn-toggle-collapse.is-collapsed-all {
  background: #EFF6FF;
  border-color: #3B82F6;
  color: #1D4ED8;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(59, 130, 246, 0.12);
}
.bot-folder-header.is-collapsed,
.bot-group-header.is-collapsed {
  background: #F8FAFC !important;
  opacity: 0.92;
}

/* =========================================================
   TAB 4: BOT COMMENT MULTI-SCENARIOS (CHUẨN SMAXBOT)
   ========================================================= */
.bot-comment-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.bot-comment-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.bot-comment-status-card {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.bot-comment-delay-field {
  width: 54px;
  padding: 4px 6px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
  background: #F8FAFC;
  font-weight: 600;
  color: #1E293B;
}

.bot-comment-notice-banner {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #B45309;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 11.5px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bot-comment-counter {
  background: #E8F5EE;
  color: #0B6047;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.bot-comment-rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.bot-comment-rules-table th {
  background: #F8FAFC;
  color: #475569;
  padding: 11px 14px;
  border-bottom: 1px solid #E2E8F0;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.3px;
  text-align: left;
}

.bot-comment-rules-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.bot-comment-rules-table tr:hover td {
  background: #FAFDFB;
}

.bot-comment-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.bot-comment-badge.badge-phone-have {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.bot-comment-badge.badge-phone-none {
  background: #EFF6FF;
  color: #2563EB;
  border: 1px solid #BFDBFE;
}

.bot-comment-badge.badge-scope {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
}

.bot-comment-badge.badge-hide {
  background: #FEF3C7;
  color: #D97706;
  border: 1px solid #FDE68A;
}

.bot-comment-badge.badge-like {
  background: #F3E8FF;
  color: #7E22CE;
  border: 1px solid #E9D5FF;
}

.bot-modal-field-group {
  margin-bottom: 12px;
  padding: 12px 14px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
}

.bot-modal-field-title {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
  display: block;
}

.bot-rule-actions-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.bot-rule-btn-icon {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 5px;
  padding: 4px 6px;
  font-size: 12px;
  cursor: pointer;
  color: #475569;
  line-height: 1;
  transition: all 0.15s ease;
}

.bot-rule-btn-icon:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
  color: #0F172A;
}

.bot-rule-btn-icon.btn-delete:hover {
  background: #FEF2F2;
  border-color: #F87171;
  color: #DC2626;
}

/* ========================================================
   META POLICY PRE-FLIGHT INSPECTOR & REVIEW BOX
   ======================================================== */
.bot-bc-policy-box {
  border-radius: 10px;
  padding: 12px 14px;
  margin: 4px 0 8px;
  transition: all 0.25s ease;
  font-size: 11.5px;
}

.bot-bc-policy-box.policy-ok {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: #14532D;
}

.bot-bc-policy-box.policy-warn {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
}

.bot-bc-policy-box.policy-danger {
  background: #FEF2F2;
  border: 1.5px solid #FCA5A5;
  color: #991B1B;
}

.bot-bc-policy-box.policy-meta-ads {
  background: #F5F3FF;
  border: 1.5px solid #DDD6FE;
  color: #5B21B6;
}

.bot-bc-policy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}

.bot-bc-policy-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.bot-bc-status-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bot-bc-status-badge.badge-green {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #86EFAC;
}

.bot-bc-status-badge.badge-red {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

.bot-bc-status-badge.badge-yellow {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FCD34D;
}

.bot-bc-status-badge.badge-purple {
  background: #EDE9FE;
  color: #6D28D9;
  border: 1px solid #C4B5FD;
}

.bot-bc-recheck-btn {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
  color: #475569;
  transition: all 0.15s ease;
}

.bot-bc-recheck-btn:hover {
  background: #F1F5F9;
  color: #0F172A;
  border-color: #94A3B8;
}

.bot-bc-policy-content {
  line-height: 1.5;
}

.bot-bc-policy-content b {
  font-weight: 700;
}

.bot-bc-keyword-pill {
  display: inline-block;
  background: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #F87171;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10.5px;
  font-family: monospace;
  font-weight: 700;
  margin: 1px 3px;
}

.bot-bc-meta-submit-btn {
  background: linear-gradient(135deg, #1877F2 0%, #0062E0 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 1px 3px rgba(24, 119, 242, 0.3);
  transition: all 0.15s ease;
}

.bot-bc-meta-submit-btn:hover {
  background: linear-gradient(135deg, #166FE5 0%, #0054C2 100%);
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(24, 119, 242, 0.4);
}

.bot-bc-secondary-btn {
  background: #FFFFFF;
  color: #0B6047;
  border: 1px solid #0B6047;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bot-bc-secondary-btn:hover {
  background: #ECFDF5;
}

/* ==========================================================================
   BLOCK PICKER HOVER PENCIL BUTTON & PEEK CONTENT MODAL (SmaxBot Style)
   ========================================================================== */

.bot-block-picker-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  width: 100%;
}

.bot-block-picker-wrap .bot-filter-select,
.bot-block-picker-wrap select.bot-block-picker-select {
  flex: 1;
  min-width: 0;
  height: 38px;
  box-sizing: border-box;
}

/* Square pencil button appearing on hover at the end of block dropdown */
.bot-block-peek-btn {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: #E2E8F0;
  border: 1px solid #CBD5E1;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
}

/* When hovering over the container (or focusing), pencil button pops out smoothly */
.bot-block-picker-wrap:hover .bot-block-peek-btn,
.bot-block-picker-wrap:focus-within .bot-block-peek-btn,
.bot-block-peek-btn:hover,
.bot-block-peek-btn:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.bot-block-peek-btn:hover {
  background: #CBD5E1;
  border-color: #94A3B8;
  color: #0B6047;
  box-shadow: 0 2px 8px rgba(11, 96, 71, 0.15);
}

.bot-block-peek-btn:active {
  transform: scale(0.95);
}

/* Peek Dialog Styling */
.bot-peek-dialog:not([open]) {
  display: none !important;
}

.bot-peek-dialog[open] {
  border: 1px solid #CBD5E1 !important;
  border-radius: 14px !important;
  background: #FFFFFF !important;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.28) !important;
  width: min(740px, 95vw) !important;
  max-width: 740px !important;
  max-height: 88vh !important;
  padding: 22px 24px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.bot-peek-dialog .workflow-dialog-heading {
  flex-shrink: 0;
  margin-bottom: 6px;
}

.bot-peek-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  margin: 12px 0 14px;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.bot-peek-group-badge {
  background: #E2E8F0;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bot-peek-id-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: #64748B;
  background: #F1F5F9;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #E2E8F0;
}

.bot-peek-count-badge {
  font-size: 12px;
  background: #E0E7FF;
  color: #3730A3;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
}

.bot-peek-desc-wrap {
  font-size: 12px;
  color: #64748B;
  margin-bottom: 14px;
  line-height: 1.5;
  background: #F8FAFC;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid #0B6047;
  flex-shrink: 0;
}

.bot-peek-cards-scroll {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 120px;
  max-height: calc(88vh - 230px);
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 4px 10px 16px 2px;
}

.bot-peek-cards-scroll::-webkit-scrollbar {
  width: 7px;
}
.bot-peek-cards-scroll::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-radius: 4px;
}
.bot-peek-cards-scroll::-webkit-scrollbar-thumb {
  background: #94A3B8;
  border-radius: 4px;
}
.bot-peek-cards-scroll::-webkit-scrollbar-thumb:hover {
  background: #64748B;
}

.bot-peek-card-item {
  flex-shrink: 0 !important; /* CRITICAL: Prevent cards from shrinking/squishing */
  min-height: fit-content !important;
  width: 100% !important;
  box-sizing: border-box !important;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  background: #FFFFFF;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.bot-peek-card-item:hover {
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.09);
  border-color: #CBD5E1;
}

.bot-peek-card-header {
  background: #F8FAFC;
  padding: 10px 14px;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #1E293B;
}

.bot-peek-card-body {
  padding: 14px;
  box-sizing: border-box;
}

.bot-peek-text-bubble {
  background: #F1F5F9;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #0F172A;
  white-space: pre-wrap;
  word-break: break-word;
}

.bot-peek-var-chip {
  background: #E0F2FE;
  color: #0369A1;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  display: inline-block;
}

.bot-peek-dialog .workflow-actions {
  flex-shrink: 0;
  margin-top: 14px !important;
  padding-top: 12px !important;
  border-top: 1px solid #E2E8F0;
}

.bot-peek-btn-row {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bot-peek-btn-item {
  background: #FFFFFF;
  border: 1.5px solid #2563EB;
  color: #1D4ED8;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.06);
}

.bot-peek-btn-target {
  font-size: 11px;
  color: #64748B;
  font-weight: 500;
}

.bot-peek-image-preview-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.bot-peek-image-thumb {
  width: 140px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #CBD5E1;
  flex-shrink: 0;
}

.bot-peek-typing-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #475569;
  background: #F8FAFC;
  padding: 8px 12px;
  border-radius: 6px;
}

.bot-peek-canvas-btn {
  background: #0F172A;
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.bot-peek-canvas-btn:hover {
  background: #1E293B;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.15);
}

/* ==========================================================================
   BOTCAKE BROADCAST ENHANCEMENTS: RATE LIMIT, AUDIENCE FILTERS & SCHEDULER
   ========================================================================== */

.bot-bc-header-audience-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.bot-bc-avatar-stack {
  display: flex;
  align-items: center;
}

.bot-bc-avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  margin-left: -8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.bot-bc-avatar-stack > :first-child {
  margin-left: 0;
}

.bot-bc-avatar-more {
  background: #0F172A;
  color: #FFFFFF;
  font-size: 9.5px;
  font-weight: 700;
}

.bot-bc-audience-text {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 12px;
}

.bot-bc-audience-label {
  color: #64748B;
  font-weight: 500;
  font-size: 11.5px;
}

.bot-bc-audience-count {
  color: #0B6047;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.bot-bc-audience-total {
  color: #94A3B8;
  font-size: 11px;
}

.bot-bc-mode-tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #86EFAC;
}

.bot-bc-mode-tag.mode-marketing {
  background: #EDE9FE;
  color: #6D28D9;
  border-color: #C4B5FD;
}

.bot-bc-mode-tag.mode-utility {
  background: #DBEAFE;
  color: #1E40AF;
  border-color: #93C5FD;
}

.bot-bc-section-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bot-bc-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #0F172A;
  font-weight: 700;
}

.bot-bc-type-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bot-bc-type-subgroup {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bot-bc-subgroup-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #64748B;
  text-transform: uppercase;
}

.bot-bc-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bot-bc-radio-card:hover {
  border-color: #94A3B8;
  background: #F8FAFC;
}

.bot-bc-radio-card.active {
  border-color: #0B6047;
  background: #F0FDF4;
  box-shadow: 0 0 0 1px #0B6047;
}

.bot-bc-radio-card.active.card-marketing {
  border-color: #7C3AED;
  background: #FAF5FF;
  box-shadow: 0 0 0 1px #7C3AED;
}

.bot-bc-radio-card.active.card-utility {
  border-color: #2563EB;
  background: #EFF6FF;
  box-shadow: 0 0 0 1px #2563EB;
}

.bot-bc-radio-card input[type="radio"] {
  margin-top: 3px;
  accent-color: #0B6047;
  cursor: pointer;
}

.bot-bc-radio-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.bot-bc-radio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bot-bc-radio-name {
  font-size: 12px;
  font-weight: 700;
  color: #0F172A;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bot-bc-badge-new {
  background: #EF4444;
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.bot-bc-radio-desc {
  font-size: 11px;
  color: #64748B;
  margin: 0;
  line-height: 1.4;
}

.bot-bc-subselect-row {
  margin-top: 6px;
  padding: 8px 10px;
  background: #EFF6FF;
  border-radius: 6px;
  border-left: 3px solid #2563EB;
}

.bot-bc-presets-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bot-bc-preset-chip {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bot-bc-preset-chip:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
}

.bot-bc-preset-chip.active {
  background: #0B6047;
  color: #FFFFFF;
  border-color: #0B6047;
  font-weight: 700;
}

.bot-bc-filter-logic-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px dashed #E2E8F0;
  border-bottom: 1px dashed #E2E8F0;
}

.bot-bc-conditions-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bot-bc-condition-row {
  display: grid;
  grid-template-columns: 36px 1.1fr 1fr 1.3fr 32px;
  gap: 8px;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 6px 8px;
}

.bot-bc-cond-when {
  font-size: 11px;
  font-weight: 700;
  color: #64748B;
  text-align: center;
}

.bot-bc-cond-delete-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.bot-bc-cond-delete-btn:hover {
  color: #EF4444;
  background: #FEE2E2;
}

.bot-bc-add-cond-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #FFFFFF;
  border: 1px dashed #94A3B8;
  color: #334155;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  width: fit-content;
}

.bot-bc-add-cond-btn:hover {
  border-color: #0B6047;
  color: #0B6047;
  background: #F0FDF4;
}

.bot-bc-filter-summary-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11.5px;
}

.bot-bc-text-action-btn {
  background: transparent;
  border: none;
  color: #64748B;
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.bot-bc-text-action-btn:hover {
  color: #EF4444;
}

.bot-bc-warning-callout {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 8px 10px;
}

.bot-bc-schedule-box {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bot-bc-timezone-tag {
  font-size: 10px;
  font-weight: 600;
  color: #475569;
  background: #F1F5F9;
  padding: 2px 6px;
  border-radius: 4px;
}

.bot-bc-golden-hours {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.bot-bc-time-chip {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bot-bc-time-chip:hover {
  background: #FEF3C7;
  border-color: #FCD34D;
  color: #B45309;
}


