/* ================= Dashboard ================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
}

.stat-card span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-card strong {
  font-size: 26px;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--space-5);
}

.dashboard-conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.dashboard-conv-item:hover {
  background: var(--surface-hover);
}

.dashboard-conv-avatar,
.dashboard-training-item .customer-avatar-large {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.dashboard-conv-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 3px;
}

.dashboard-conv-name {
  font-weight: 600;
}

.dashboard-conv-time {
  color: var(--text-faint);
  font-size: 11px;
}

.dashboard-conv-preview {
  font-size: 12.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-training-item {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.dashboard-training-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.dashboard-training-title {
  font-weight: 600;
  font-size: 13px;
}

.dashboard-training-status {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.dashboard-training-status.live {
  color: var(--green);
  background: rgba(34, 197, 94, 0.12);
}

.dashboard-training-status.draft {
  color: var(--amber);
  background: rgba(245, 158, 11, 0.12);
}

.dashboard-training-preview {
  font-size: 12px;
  color: var(--text-muted);
}

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

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* ================= Inbox ================= */

.inbox-page {
  padding: 0;
  max-width: none;
  height: calc(100vh - 0px);
}

.inbox-layout {
  display: grid;
  grid-template-columns: 320px 1fr 300px;
  height: 100vh;
}

.inbox-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  transition: width 0.2s ease;
}

.inbox-sidebar.collapsed {
  width: 0;
  overflow: hidden;
  border-right: none;
}

.inbox-sidebar-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.inbox-sidebar-top h2 {
  font-size: 17px;
}

.inbox-sidebar-top p {
  font-size: 12px;
  color: var(--text-muted);
}

.inbox-sidebar-toggle {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 11px;
}

.inbox-search-wrap {
  padding: var(--space-3) var(--space-4);
}

.inbox-search {
  width: 100%;
}

.inbox-labels {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 var(--space-3) var(--space-3);
}

.inbox-label {
  display: flex;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
}

.inbox-label:hover {
  background: var(--surface-hover);
}

.inbox-label.active {
  background: rgba(124, 92, 255, 0.14);
  color: var(--brand-light);
  font-weight: 600;
}

.label-count {
  background: var(--bg-elevated);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
}

.conversations-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.conv-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px var(--space-4);
  border-bottom: 1px solid var(--border);
}

.conv-item:hover,
.conv-item.active {
  background: var(--surface-hover);
}

.conv-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
}

.conv-name {
  font-weight: 600;
  font-size: 13.5px;
}

.conv-time {
  font-size: 11px;
  color: var(--text-faint);
}

.conv-preview {
  font-size: 12.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 6px;
}

.conv-tags {
  display: flex;
  gap: 6px;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.chat-person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar,
.customer-avatar-large {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-person h3 {
  font-size: 14.5px;
}

.chat-person p {
  font-size: 11.5px;
  color: var(--text-muted);
}

.chat-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ai-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.ai-toggle-wrap input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ai-toggle-slider {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
  background: var(--border-light);
  border-radius: 999px;
  transition: 0.2s;
  flex-shrink: 0;
}

.ai-toggle-slider::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.ai-toggle-wrap input:checked + .ai-toggle-slider {
  background: var(--brand-gradient);
}

.ai-toggle-wrap input:checked + .ai-toggle-slider::before {
  transform: translateX(14px);
}

.ai-toggle-text {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brand-light);
}

.ai-toggle-text.ai-off {
  color: var(--text-faint);
}

.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-6);
}

.chat-empty-icon {
  font-size: 40px;
  margin-bottom: var(--space-3);
}

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.msg {
  max-width: 68%;
  display: flex;
  flex-direction: column;
}

.msg.incoming {
  align-self: flex-start;
}

.msg.outgoing {
  align-self: flex-end;
}

.msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
}

.msg.incoming .msg-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg.outgoing .msg-bubble {
  background: var(--brand-gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-meta {
  font-size: 10.5px;
  color: var(--text-faint);
  margin-top: 4px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.msg.outgoing .msg-meta {
  align-self: flex-end;
}

.ai-badge {
  background: rgba(124, 92, 255, 0.16);
  color: var(--brand-light);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
}

.message-form {
  display: flex;
  gap: 10px;
  padding: var(--space-4);
  border-top: 1px solid var(--border);
}

.chat-textarea {
  flex: 1;
  resize: none;
  max-height: 140px;
}

.send-btn {
  background: var(--brand-gradient);
  color: #fff;
  padding: 0 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13.5px;
}

.customer-panel {
  border-left: 1px solid var(--border);
  padding: var(--space-4);
  overflow-y: auto;
}

.customer-panel-header h3 {
  font-size: 14px;
  margin-bottom: var(--space-4);
}

.customer-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-5);
}

.customer-profile h4 {
  font-size: 14px;
}

.customer-profile p {
  font-size: 11.5px;
  color: var(--text-muted);
}

.customer-info-list {
  margin-bottom: var(--space-5);
}

.customer-info-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.customer-info-row span {
  color: var(--text-muted);
}

.customer-note-section label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.customer-note-section textarea {
  width: 100%;
  margin-bottom: var(--space-3);
  resize: vertical;
}

@media (max-width: 1200px) {
  .inbox-layout {
    grid-template-columns: 280px 1fr;
  }

  .customer-panel {
    display: none;
  }
}

/* ================= Training Portal ================= */

.training-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.training-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: 12px;
}

.training-summary-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.training-summary-icon.purple {
  background: rgba(124, 92, 255, 0.14);
  color: var(--brand-light);
}

.training-summary-icon.green {
  background: rgba(34, 197, 94, 0.14);
  color: var(--green);
}

.training-summary-icon.amber {
  background: rgba(245, 158, 11, 0.14);
  color: var(--amber);
}

.training-summary-icon.blue {
  background: rgba(59, 130, 246, 0.14);
  color: var(--blue);
}

.training-summary-label {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
}

.training-summary-card strong {
  font-size: 20px;
}

.training-toolbar {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.training-search-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.training-search-wrap span {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
}

.training-search-wrap input {
  width: 100%;
  padding-left: 32px;
}

.training-filter-wrap {
  display: flex;
  gap: 8px;
}

.training-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}

.training-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.training-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.training-id {
  font-size: 10.5px;
  color: var(--text-faint);
  margin-right: 6px;
}

.training-category-badge {
  font-size: 10.5px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 999px;
}

.training-status {
  font-size: 11px;
  font-weight: 700;
}

.training-status.status-live {
  color: var(--green);
}

.training-status.status-draft {
  color: var(--amber);
}

.training-title {
  font-size: 14.5px;
  margin-bottom: 6px;
}

.training-preview {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  line-height: 1.5;
}

.training-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-faint);
  margin-bottom: var(--space-3);
}

.training-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.training-empty-state,
.empty-training-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-7) var(--space-4);
  color: var(--text-muted);
}

.training-empty-icon,
.empty-training-icon {
  font-size: 34px;
  margin-bottom: var(--space-3);
}

.training-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.training-full-width {
  grid-column: 1 / -1;
}

.training-form-note {
  display: flex;
  gap: 10px;
  background: rgba(124, 92, 255, 0.1);
  border: 1px solid rgba(124, 92, 255, 0.25);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

/* ================= Test Portal ================= */

.test-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-5);
  align-items: start;
}

.test-training-list {
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: var(--space-3) 0;
}

.test-training-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
}

.test-training-item:hover {
  background: var(--surface-hover);
}

.test-training-title {
  font-size: 12.5px;
  font-weight: 600;
}

.test-training-meta {
  font-size: 11px;
  color: var(--text-faint);
}

.test-training-note {
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.6;
}

.test-chat-card {
  display: flex;
  flex-direction: column;
  height: 640px;
}

.test-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4);
}

.test-ai-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.test-ai-profile h3 {
  font-size: 14px;
}

.test-ai-profile p {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

.test-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 4px;
}

.ai-msg,
.user-msg {
  display: flex;
  gap: 10px;
  max-width: 78%;
}

.user-msg {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-bubble,
.user-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
}

.ai-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}

.user-bubble {
  background: var(--brand-gradient);
  color: #fff;
  border-top-right-radius: 4px;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  animation: typing-bounce 1.1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing-bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.test-input-area {
  display: flex;
  gap: 10px;
  margin-top: var(--space-4);
}

.test-input-area textarea {
  flex: 1;
  resize: none;
}

.test-help-text {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 8px;
}

@media (max-width: 950px) {
  .test-layout {
    grid-template-columns: 1fr;
  }
}

/* ================= Broadcast ================= */

.broadcast-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-5);
  align-items: start;
}

.broadcast-textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
}

.broadcast-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.broadcast-history-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.broadcast-history-message {
  font-size: 12.5px;
  margin-bottom: 4px;
}

.broadcast-history-meta {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: capitalize;
}

.template-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-list .btn-sm {
  text-align: left;
}

@media (max-width: 950px) {
  .broadcast-layout {
    grid-template-columns: 1fr;
  }
}

/* ================= Connect ================= */

.connect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-5);
}

.connect-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.connect-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.connect-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
}

.connect-icon.fb {
  background: #1877f2;
}

.connect-icon.ig {
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
}

.connect-icon.wa {
  background: #25d366;
}

.connect-status {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  background: var(--bg-elevated);
  padding: 3px 9px;
  border-radius: 999px;
}

.connect-status.connected {
  color: var(--green);
}

.connect-card h3 {
  font-size: 15px;
  margin-bottom: 6px;
}

.connect-card p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  min-height: 36px;
}

/* ================= Settings ================= */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.settings-card h3 {
  font-size: 14.5px;
  margin-bottom: var(--space-4);
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-info h4 {
  font-size: 13px;
  margin-bottom: 2px;
}

.setting-info p {
  font-size: 11.5px;
  color: var(--text-muted);
}

.settings-save-btn {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: var(--space-2);
}

@media (max-width: 950px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* ================= Notice Board ================= */

.notice-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.notice-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
}

.notice-item.notice-green {
  border-left-color: var(--green);
}

.notice-item.notice-amber {
  border-left-color: var(--amber);
}

.notice-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.notice-top h4 {
  font-size: 14.5px;
}

.notice-top span {
  font-size: 11px;
  color: var(--text-faint);
}

.notice-item p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ================= AI Thoughts ================= */

.thoughts-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.thought-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: 12px;
}

.thought-summary-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.thought-summary-icon.conflict {
  background: rgba(239, 68, 68, 0.14);
}

.thought-summary-icon.learn {
  background: rgba(34, 197, 94, 0.14);
}

.thought-summary-icon.idea {
  background: rgba(245, 158, 11, 0.14);
}

.thought-summary-icon.doubt {
  background: rgba(59, 130, 246, 0.14);
}

.thought-summary-card span {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
}

.thought-summary-card strong {
  font-size: 20px;
}

.thought-filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.thought-filter {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.thought-filter.active {
  background: var(--brand-gradient);
  color: #fff;
  border-color: transparent;
}

.thoughts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.thought-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
}

.thought-conflict {
  border-left-color: var(--red);
}

.thought-learn {
  border-left-color: var(--green);
}

.thought-idea {
  border-left-color: var(--amber);
}

.thought-doubt {
  border-left-color: var(--blue);
}

.thought-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-2);
}

.thought-type {
  font-weight: 700;
  font-size: 13.5px;
}

.thought-dismiss-btn {
  color: var(--text-faint);
  font-size: 14px;
}

.thought-dismiss-btn:hover {
  color: var(--red);
}

.thought-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.thought-actions {
  display: flex;
  gap: 8px;
}

.thought-btn {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.thought-btn.train {
  background: rgba(124, 92, 255, 0.14);
  color: var(--brand-light);
}

.thought-btn.ignore {
  background: var(--bg-elevated);
  color: var(--text-muted);
}

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

/* ================= Billing ================= */

.billing-status-card {
  margin-bottom: var(--space-5);
}

.billing-status {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--text-faint);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.billing-status.active {
  border-left-color: var(--green);
}

.billing-status.inactive {
  border-left-color: var(--amber);
}

.billing-status-label {
  font-size: 11.5px;
  color: var(--text-muted);
}

.billing-status h3 {
  font-size: 18px;
  margin: 4px 0;
}

.billing-status p {
  font-size: 12.5px;
  color: var(--text-muted);
}

.billing-plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.billing-plan-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.billing-plan-card.featured {
  border-color: var(--brand);
  box-shadow: var(--shadow-glow);
}

.billing-plan-badge {
  position: absolute;
  top: -10px;
  right: 20px;
  background: var(--brand-gradient);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.billing-plan-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.billing-plan-price {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: var(--space-4);
}

.billing-plan-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.billing-plan-card li {
  font-size: 12.5px;
  color: var(--text-muted);
  padding-left: 18px;
  position: relative;
}

.billing-plan-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

.billing-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.14), rgba(79, 124, 255, 0.1));
  border: 1px solid rgba(124, 92, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  flex-wrap: wrap;
}

.billing-cta-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.billing-cta-card p {
  font-size: 12.5px;
  color: var(--text-muted);
  max-width: 420px;
}

@media (max-width: 950px) {
  .billing-plans-grid {
    grid-template-columns: 1fr;
  }
}
