/* ==========================================================================
   MITRAKU AI — PREMIUM AI SAAS DESIGN SYSTEM & STYLESHEET
   Brand Colors: Emerald Green & Slate Neutrals
   Supported Themes: Light Mode & Dark Mode
   ========================================================================== */

:root {
  /* Brand Accent Colors */
  --brand-50: #f0fdf4;
  --brand-100: #dcfce7;
  --brand-200: #bbf7d0;
  --brand-300: #86efac;
  --brand-400: #4ade80;
  --brand-500: #16a34a;
  --brand-600: #15803d;
  --brand-700: #166534;
  --brand-bright: #22c55e;
  --brand-glow: rgba(22, 163, 74, 0.25);

  /* Semantic Status & Module Colors */
  --color-success: #10b981;
  --color-info: #3b82f6;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-danger-strong: #dc2626;
  --color-indigo: #6366f1;
  --color-ai-teal: #14b8a6;
  --color-ai-purple: #a855f7;
  --color-ai-pink: #ec4899;
  --color-ai-orange: #f97316;

  /* Focus Rings (a11y) */
  --focus-ring: 0 0 0 3px rgba(22, 163, 74, 0.35);
  --ring-input: 0 0 0 3px rgba(16, 185, 129, 0.15);

  /* Spacing Scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Type Scale */
  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 14px;
  --text-base: 15px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 34px;

  /* Light Theme Variables */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-sidebar: #f1f5f9;
  --bg-hover: #e2e8f0;
  --bg-active: var(--bg-hover);
  --bg-composer: #ffffff;
  --bg-bubble-user: #f1f5f9;
  --bg-bubble-ai: #ffffff;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-brand: 0 4px 14px rgba(22, 163, 74, 0.3);

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-full: 9999px;
  
  --sidebar-w: 260px;
  --topbar-h: 56px;
}

[data-theme="dark"] {
  --bg-app: #090d16;
  --bg-surface: #111827;
  --bg-sidebar: #0d1322;
  --bg-hover: #1f2937;
  --bg-active: var(--bg-hover);
  --bg-composer: #111827;
  --bg-bubble-user: #1f2937;
  --bg-bubble-ai: #111827;

  --focus-ring: 0 0 0 3px rgba(74, 222, 128, 0.35);

  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-subtle: #6b7280;
  --border-subtle: #1f2937;
  --border-strong: #374151;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-brand: 0 4px 16px rgba(22, 163, 74, 0.4);
}

/* Base Reset & Layout */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* App Master Layout */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ==========================================================================
   SIDEBAR (260px Width)
   ========================================================================== */
.sidebar {
  width: var(--sidebar-w);
  height: 100%;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 50;
  overflow: hidden;
  margin-left: 0;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.2s,
              border-color 0.2s;
}

/* Desktop: collapsed state (slide left) */
.sidebar.collapsed {
  margin-left: calc(-1 * var(--sidebar-w));
}

.sidebar-header {
  padding: 16px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-brand);
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-main);
}

.brand-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-full);
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-200);
}

[data-theme="dark"] .brand-tag {
  background: rgba(22, 163, 74, 0.15);
  color: var(--brand-200);
  border-color: rgba(22, 163, 74, 0.3);
}

/* Primary Button: New Chat */
.sidebar-action-wrap {
  padding: 0 14px 10px;
}

.btn-new-chat {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.btn-new-chat:hover {
  background: var(--brand-500);
  color: white;
  border-color: var(--brand-600);
  box-shadow: var(--shadow-brand);
  transform: translateY(-1px);
}

/* Search Box */
.sidebar-search-wrap {
  padding: 0 14px 10px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 0 10px;
  height: 34px;
}

.search-box svg {
  color: var(--text-subtle);
  flex-shrink: 0;
}

.search-box input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 0 6px;
  font-size: 12.5px;
  color: var(--text-main);
}

.search-box input::placeholder {
  color: var(--text-subtle);
}

.search-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
}

/* History List & Grouping */
.history-container {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px;
}

.history-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-subtle);
  padding: 12px 10px 4px;
}

.history-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  margin-bottom: 2px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.history-item:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.history-item.active {
  background: var(--bg-surface);
  color: var(--brand-600);
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .history-item.active {
  color: var(--brand-400);
}

.history-item-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  padding-right: 6px;
}

.history-item-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  cursor: pointer;
}

.history-item:hover .history-item-menu-btn {
  display: flex;
}

/* Context Menu Dropdown */
.history-context-menu {
  position: absolute;
  right: 8px;
  top: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  width: 140px;
  padding: 4px 0;
}

.context-menu-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}

.context-menu-btn:hover {
  background: var(--bg-hover);
}

.context-menu-btn.danger {
  color: var(--color-danger);
}

/* Empty History */
.history-empty-state {
  text-align: center;
  padding: 30px 16px;
}

.empty-icon {
  font-size: 28px;
  margin-bottom: 8px;
  opacity: 0.6;
}

.empty-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.empty-sub {
  font-size: 11.5px;
  color: var(--text-subtle);
  margin-top: 2px;
}

/* Sidebar Footer & Status */
.sidebar-footer {
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border-subtle);
}

.pipeline-status-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 10px 12px;
}

.pipe-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.pipe-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-subtle);
  flex-shrink: 0;
}

.pipe-dot.dot-green { background: var(--brand-bright); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }
.pipe-dot.dot-orange { background: var(--color-ai-orange); box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2); }
.pipe-dot.dot-red { background: var(--color-danger); }

.btn-sidebar-trigger {
  width: 100%;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: white;
  border: none;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition: all 0.2s;
}

.btn-sidebar-trigger:hover {
  transform: translateY(-1px);
}

/* ==========================================================================
   MAIN CONTENT AREA & TOP BAR
   ========================================================================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
}

/* Top Bar */
.top-bar {
  height: var(--topbar-h);
  padding: 0 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 30;
}

.top-left, .top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

/* Product Selector Pill */
.product-selector-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-full);
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  line-height: 1.5;
  white-space: nowrap;
}

.product-selector-pill:hover {
  border-color: var(--brand-500);
  background: var(--bg-surface);
}

/* Model Dropdown Selector */
.model-dropdown-wrap {
  position: relative;
}

.model-selector-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-lg);
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
}

.model-selector-btn:hover {
  background: var(--bg-surface);
  border-color: var(--border-strong);
}

.model-sparkle {
  color: var(--brand-500);
}

.model-dropdown-menu {
  position: absolute;
  right: 0;
  top: 42px;
  width: 240px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 100;
}

.dropdown-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-subtle);
  padding: 4px 8px 8px;
  text-transform: uppercase;
}

.model-menu-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.15s ease;
}

.model-menu-item:hover {
  background: var(--bg-hover);
}

/* Item yang API key tersedia — highlight subtle */
.model-menu-item:not(.disabled):hover {
  background: var(--bg-hover);
}

.model-menu-item.disabled {
  opacity: 0.5;
  cursor: default;
}

.model-menu-item input {
  margin-top: 3px;
  accent-color: var(--brand-500);
  flex-shrink: 0;
}

.item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
}

.item-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* "Aktif" desc text berwarna hijau */
.item-desc[id]:not(:empty) {
  transition: color 0.2s;
}

/* ==========================================================================
   CHAT MESSAGES AREA & EMPTY STATE
   ========================================================================== */
.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}

/* Empty State */
.empty-state {
  max-width: 680px;
  margin: auto;
  text-align: center;
  padding: 40px 20px;
  animation: fadeIn 0.4s ease-out;
}

.hero-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-brand);
}

.hero-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.hero-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 32px;
  text-align: left;
}

.sug-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.sug-card:hover {
  border-color: var(--brand-500);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.sug-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.sug-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.sug-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Chat Message Rows */
.message-row {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  gap: 14px;
  animation: fadeIn 0.25s ease-out;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.user-row .message-avatar {
  background: var(--text-main);
  color: var(--bg-surface);
}

.bot-row .message-avatar {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: white;
  box-shadow: var(--shadow-brand);
}

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

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.meta-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

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

.bubble {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-main);
}

.user-row .bubble {
  background: var(--bg-bubble-user);
  padding: 12px 16px;
  border-radius: var(--r-lg);
  border-top-left-radius: 2px;
}

.bot-row .bubble {
  background: transparent;
}

/* AI Message Markdown Elements */
.bubble p { margin-bottom: 12px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble h1, .bubble h2, .bubble h3 { font-weight: 700; margin: 16px 0 8px; color: var(--text-main); }
.bubble h1 { font-size: 20px; }
.bubble h2 { font-size: 17px; }
.bubble h3 { font-size: 15px; }

.bubble ul, .bubble ol { margin: 8px 0 12px 20px; }
.bubble li { margin-bottom: 4px; }

.bubble pre {
  margin: 12px 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #1e293b;
  color: #f8fafc;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: #0f172a;
  font-size: 11px;
  color: #94a3b8;
}

.copy-btn {
  background: transparent;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
}

.copy-btn:hover { background: #334155; color: white; }

.bubble code {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.06);
}

[data-theme="dark"] .bubble code {
  background: rgba(255,255,255,0.1);
}

.tp-engine-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.5;
}
.tp-engine-rag {
  color: #059669;
  background: rgba(5, 150, 105, 0.10);
  border: 1px solid rgba(5, 150, 105, 0.30);
}
.tp-engine-context {
  color: var(--text-muted);
  background: rgba(100, 116, 139, 0.08);
  border: 1px dashed rgba(100, 116, 139, 0.35);
}

/* Hover Action Bar on AI Messages */
.message-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.message-row:hover .message-actions {
  opacity: 1;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--r-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11.5px;
  cursor: pointer;
}

.action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

/* Thinking Dots */
.thinking {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

.tdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-500);
  animation: bounce 1.4s infinite ease-in-out both;
}

.tdot:nth-child(1) { animation-delay: -0.32s; }
.tdot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ==========================================================================
   STICKY COMPOSER & PIPELINE BANNER
   ========================================================================== */
.composer-container {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px 16px;
  position: relative;
}

/* Banner */
.pipeline-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--brand-50), #ecfdf5);
  border: 1px solid var(--brand-200);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  animation: slideUp 0.3s ease-out;
}

[data-theme="dark"] .pipeline-banner {
  background: linear-gradient(135deg, #064e3b, #022c22);
  border-color: #047857;
}

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

.banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.banner-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-700);
}

[data-theme="dark"] .banner-title { color: #a7f3d0; }

.banner-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.btn-banner-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: white;
  border: none;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-brand);
}

.btn-banner-trigger:hover { transform: translateY(-1px); }

/* Composer Card */
.composer-card {
  background: var(--bg-composer);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: 10px 12px 8px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.composer-card:focus-within {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.composer-input-row textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text-main);
  font-size: 14.5px;
  line-height: 1.5;
  max-height: 160px;
  padding: 2px 4px;
}

.composer-input-row textarea::placeholder {
  color: var(--text-subtle);
}

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--r-md);
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
}

.tool-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.composer-active-product {
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 4px 8px;
  background: var(--bg-app);
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.5;
}

.btn-send {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition: all 0.2s;
}

.btn-send:hover {
  transform: scale(1.06);
}

.btn-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.composer-footnote {
  font-size: 11px;
  color: var(--text-subtle);
  text-align: center;
  margin-top: 8px;
}

/* Pipeline Result: Asset Gallery */
.asset-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.asset-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-surface);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
}

.asset-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.asset-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.asset-label {
  font-size: 10.5px;
  font-weight: 700;
  padding: 6px 8px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pipeline Result: Video Card */
.video-result-card {
  margin-top: 14px;
  padding: 16px;
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: var(--r-xl);
}

[data-theme="dark"] .video-result-card {
  background: rgba(4, 120, 87, 0.12);
  border-color: rgba(4, 120, 87, 0.35);
}

.video-result-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brand-700);
  margin-bottom: 10px;
}

[data-theme="dark"] .video-result-title { color: #a7f3d0; }

.result-video {
  width: 100%;
  max-width: 360px;
  border-radius: var(--r-lg);
  border: 1px solid var(--brand-200);
  display: block;
  background: #000;
}

.btn-download-video {
  display: inline-flex;
  width: auto !important;
  padding: 8px 18px !important;
  font-size: 12px !important;
  margin-top: 10px;
  text-decoration: none;
}

/* Pipeline Result: Info bar */
.result-info-bar {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--bg-app);
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
}

.result-info-bar code {
  font-family: var(--font-mono);
  font-size: 11px;
}

/* Error row */
.error-row .bubble {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.05);
  padding: 10px 14px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   MODALS & OVERLAYS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 100%;
  overflow: hidden;
  animation: scaleUp 0.2s ease-out;
}

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

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 20px;
}

.modal-help-text {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r-md);
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  outline: none;
}

.form-group input:focus {
  border-color: var(--brand-500);
  background: var(--bg-surface);
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.btn-secondary {
  padding: 8px 16px;
  border-radius: var(--r-md);
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
}

.btn-danger {
  padding: 8px 16px;
  border-radius: var(--r-md);
  background: var(--color-danger);
  color: white;
  border: none;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary-action {
  padding: 8px 16px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: white;
  border: none;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
}



/* Confirm Card */
.modal-confirm-card {
  text-align: center;
  padding: 24px;
}

.confirm-icon { font-size: 32px; margin-bottom: 10px; }
.confirm-title { font-size: 17px; font-weight: 700; }
.confirm-desc { font-size: 13px; color: var(--text-muted); margin: 6px 0 20px; }

.confirm-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* Overlay Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 40;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 1024px) {
  .suggestion-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Mobile */
@media (max-width: 768px) {
  /* On mobile the sidebar is a full-height drawer; override desktop collapsed width */
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
    overflow-y: auto;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* Ignore desktop collapsed class on mobile */
  .sidebar.collapsed {
    width: var(--sidebar-w) !important;
  }

  .sidebar-overlay.open {
    display: block;
  }

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

  .composer-container {
    padding: 0 12px 12px;
  }

  .top-bar {
    padding: 0 14px;
  }

  .product-selector-pill .pill-label {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .model-dropdown-menu {
    right: 0;
    width: 200px;
  }

  /* Sidebar nav — kompak di layar kecil */
  .sidebar-nav {
    padding: 6px 8px 4px;
  }

  .sidebar-nav .view-tab-btn {
    padding: 6px 8px;
    font-size: 12px;
  }

  .product-selector-pill {
    padding: 5px 8px;
  }

  .product-selector-pill .pill-label {
    display: none;
  }

  .model-selector-btn #model-selected-label {
    display: none;
  }

  .model-selector-btn {
    padding: 5px 8px;
  }
}

/* About Developer Modal Card */
.modal-about-card {
  max-width: 520px;
}

.developer-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
}

.dev-avatar {
  font-size: 32px;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-brand);
}

.dev-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
}

.dev-role {
  font-size: 12.5px;
  color: var(--brand-600);
  font-weight: 700;
}

.dev-univ {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.dev-badge-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
}

.dev-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-200);
  border-radius: var(--r-lg);
}

[data-theme="dark"] .dev-badge {
  background: rgba(22, 163, 74, 0.15);
  color: var(--brand-200);
  border-color: rgba(22, 163, 74, 0.3);
}

.dev-desc-box, .dev-stack-box {
  margin-top: 14px;
}

.dev-desc-box h4, .dev-stack-box h4 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.dev-desc-box p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

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

.stag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--r-md);
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

/* ==========================================================================
   SIDEBAR NAVIGATION (GROUPED IA)
   ========================================================================== */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 10px 6px;
}

.sidebar-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 8px;
  margin-bottom: 6px;
}

.sidebar-nav .view-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--r-lg);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.sidebar-nav .view-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.sidebar-nav .view-tab-btn.active {
  color: var(--brand-700);
  background: var(--bg-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

[data-theme="dark"] .sidebar-nav .view-tab-btn.active {
  color: var(--brand-300);
  background: rgba(255, 255, 255, 0.06);
}

/* Sidebar App Status Card */
.app-status-card {
  padding: 10px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-bright);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.status-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.status-sub {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* ==========================================================================
   VIEW CONTAINERS & COPYWRITING FACTORY LAYOUT
   ========================================================================== */
.view-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

#chat-view {
  overflow: hidden;
}

#copywriting-view {
  background: var(--bg-app);
  padding: 24px 28px;
}

#brandkit-view {
  background: var(--bg-app);
  padding: 24px 28px;
}

#tokopintar-view {
  background: var(--bg-app);
  padding: 24px 28px;
}

#marketresearch-view {
  background: var(--bg-app);
  padding: 24px 28px;
}

#settings-view {
  background: var(--bg-app);
  padding: 24px 28px;
  width: 100%;
}


.copywriting-wrapper {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header Banner */
.cw-header-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(59, 130, 246, 0.06));
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-2xl);
  padding: 28px 32px;
  position: relative;
  overflow: hidden;
}

/* Per-module banner gradient tints */
.cw-banner-copywriting {
  background: linear-gradient(135deg, rgba(16,185,129,0.10) 0%, rgba(59,130,246,0.07) 100%);
  border-color: rgba(16,185,129,0.18);
}
.cw-banner-brandkit {
  background: linear-gradient(135deg, rgba(168,85,247,0.10) 0%, rgba(236,72,153,0.06) 100%);
  border-color: rgba(168,85,247,0.18);
}
.cw-banner-tokopintar {
  background: linear-gradient(135deg, rgba(16,185,129,0.10) 0%, rgba(20,184,166,0.07) 100%);
  border-color: rgba(16,185,129,0.18);
}
.cw-banner-risetpasar {
  background: linear-gradient(135deg, rgba(59,130,246,0.10) 0%, rgba(99,102,241,0.07) 100%);
  border-color: rgba(59,130,246,0.18);
}

[data-theme="dark"] .cw-banner-copywriting { background: linear-gradient(135deg, rgba(16,185,129,0.12) 0%, rgba(59,130,246,0.08) 100%); }
[data-theme="dark"] .cw-banner-brandkit    { background: linear-gradient(135deg, rgba(168,85,247,0.13) 0%, rgba(236,72,153,0.08) 100%); }
[data-theme="dark"] .cw-banner-tokopintar  { background: linear-gradient(135deg, rgba(16,185,129,0.12) 0%, rgba(20,184,166,0.08) 100%); }
[data-theme="dark"] .cw-banner-risetpasar  { background: linear-gradient(135deg, rgba(59,130,246,0.12) 0%, rgba(99,102,241,0.08) 100%); }

/* Decorative layer behind content */
.banner-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.deco-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.18;
}
.deco-blob-1 {
  width: 200px; height: 200px;
  right: -40px; top: -60px;
  background: radial-gradient(circle, var(--brand-500), transparent 70%);
}
.deco-blob-2 {
  width: 140px; height: 140px;
  right: 120px; bottom: -40px;
  background: radial-gradient(circle, var(--color-info), transparent 70%);
  opacity: 0.12;
}
.cw-banner-brandkit .deco-blob-1 { background: radial-gradient(circle, var(--color-ai-purple), transparent 70%); }
.cw-banner-brandkit .deco-blob-2 { background: radial-gradient(circle, var(--color-ai-pink), transparent 70%); }
.cw-banner-risetpasar .deco-blob-1 { background: radial-gradient(circle, var(--color-info), transparent 70%); }
.cw-banner-risetpasar .deco-blob-2 { background: radial-gradient(circle, var(--color-indigo), transparent 70%); }

.deco-icon-cluster {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-main);
  opacity: 0.9;
}

/* Banner inner content layout */
.banner-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.banner-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* Powered by AI pill */
.banner-ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.10);
  border: 1px solid rgba(124, 58, 237, 0.22);
  padding: 3px 10px;
  border-radius: 999px;
}
[data-theme="dark"] .banner-ai-pill {
  color: #c4b5fd;
  background: rgba(124,58,237,0.18);
  border-color: rgba(167,139,250,0.3);
}

/* Feature highlights bar */
.banner-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
}

.banner-hl-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.hl-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hl-green   { background: var(--brand-500); }
.hl-blue    { background: var(--color-info); }
.hl-purple  { background: var(--color-ai-purple); }
.hl-indigo  { background: var(--color-indigo); }
.hl-pink    { background: var(--color-ai-pink); }
.hl-orange  { background: var(--color-warning); }
.hl-teal    { background: var(--color-ai-teal); }

.cw-header-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--brand-700);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
}

[data-theme="dark"] .cw-header-badge {
  color: var(--brand-300);
}

.cw-header-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 7px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.cw-header-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 620px;
  line-height: 1.6;
}

/* Grid Layout: Form vs Result */
.cw-main-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  align-items: start;
}

/* Left Form Panel */
.cw-form-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-2xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.cw-form-group {
  margin-bottom: 18px;
}

.cw-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.cw-req {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-danger);
}

.cw-input, .cw-textarea {
  width: 100%;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-main);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cw-input:focus, .cw-textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: var(--ring-input);
}

.cw-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Platform Options Selector */
.platform-selector-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.platform-option {
  position: relative;
  cursor: pointer;
  display: block;
}

.platform-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.platform-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-app);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-xl);
  transition: all 0.2s ease;
}

.platform-option:hover .platform-box {
  border-color: var(--brand-400);
}

.platform-option.active .platform-box {
  border-color: var(--brand-500);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(59, 130, 246, 0.04));
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
}

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

.platform-info {
  display: flex;
  flex-direction: column;
}

.platform-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.platform-sub {
  font-size: 11px;
  color: var(--text-muted);
}


/* ==========================================================================
   MODULE FEATURE CARDS (Intercom-style)
   ========================================================================== */
.module-feature-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.mfc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-2xl);
  padding: 20px 18px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: default;
}

.mfc-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Colored top accent bar */
.mfc-top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
}

.mfc-card-green  .mfc-top-bar { background: linear-gradient(90deg, var(--brand-500), var(--brand-400)); }
.mfc-card-blue   .mfc-top-bar { background: linear-gradient(90deg, var(--color-info), #60a5fa); }
.mfc-card-purple .mfc-top-bar { background: linear-gradient(90deg, #9333ea, #c084fc); }
.mfc-card-pink   .mfc-top-bar { background: linear-gradient(90deg, #db2777, #f472b6); }
.mfc-card-indigo .mfc-top-bar { background: linear-gradient(90deg, #4f46e5, #818cf8); }
.mfc-card-red    .mfc-top-bar { background: linear-gradient(90deg, var(--color-danger-strong), #f87171); }
.mfc-card-teal   .mfc-top-bar { background: linear-gradient(90deg, #0d9488, #2dd4bf); }
.mfc-card-orange .mfc-top-bar { background: linear-gradient(90deg, #d97706, #fbbf24); }

/* Card background tints */
.mfc-card-green  { background: linear-gradient(160deg, rgba(16,163,74,0.04) 0%, var(--bg-surface) 60%); }
.mfc-card-blue   { background: linear-gradient(160deg, rgba(59,130,246,0.05) 0%, var(--bg-surface) 60%); }
.mfc-card-purple { background: linear-gradient(160deg, rgba(147,51,234,0.05) 0%, var(--bg-surface) 60%); }
.mfc-card-pink   { background: linear-gradient(160deg, rgba(219,39,119,0.05) 0%, var(--bg-surface) 60%); }
.mfc-card-indigo { background: linear-gradient(160deg, rgba(79,70,229,0.05) 0%, var(--bg-surface) 60%); }
.mfc-card-red    { background: linear-gradient(160deg, rgba(220,38,38,0.05) 0%, var(--bg-surface) 60%); }
.mfc-card-teal   { background: linear-gradient(160deg, rgba(13,148,136,0.05) 0%, var(--bg-surface) 60%); }

.mfc-icon {
  font-size: 28px;
  margin-bottom: 10px;
  margin-top: 4px;
  display: block;
  line-height: 1;
}

.mfc-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  letter-spacing: -0.1px;
}

.mfc-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

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


.btn-generate-cw {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: white;
  border: none;
  border-radius: var(--r-xl);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition: all 0.2s ease;
  margin-top: 8px;
}

.btn-generate-cw:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.btn-generate-cw:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Right Output Results Panel */
.cw-result-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-2xl);
  padding: 24px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

/* Empty Output State */
.cw-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.cw-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.cw-empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.cw-empty-state p {
  font-size: 13px;
  max-width: 360px;
  line-height: 1.5;
}

/* Loading Spinner State */
.cw-loading-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.cw-spinner {
  width: 44px;
  height: 44px;
  border: 3.5px solid var(--border-subtle);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.cw-loading-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.cw-loading-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Results Content & Cards */
.cw-results-wrapper {
  width: 100%;
}

.cw-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.cw-result-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cw-platform-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
}

.badge-shopee { background: rgba(238, 77, 45, 0.12); color: #ee4d2d; border-color: rgba(238, 77, 45, 0.3); }
.badge-tiktok { background: rgba(0, 0, 0, 0.08); color: var(--text-main); border-color: var(--border-subtle); }
.badge-instagram { background: rgba(225, 48, 108, 0.12); color: #e1306c; border-color: rgba(225, 48, 108, 0.3); }

.cw-result-heading {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.cw-cards-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cw-card {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: border-color 0.2s;
}

.cw-card:hover {
  border-color: var(--brand-300);
}

.cw-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border-subtle);
}

.cw-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.btn-copy-card {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy-card:hover {
  background: var(--brand-500);
  color: white;
  border-color: var(--brand-500);
}

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

.cw-text-content {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-main);
  white-space: pre-wrap;
}

.cw-code-block {
  background: var(--bg-surface);
  padding: 12px;
  border-radius: var(--r-lg);
  font-family: 'Fira Code', monospace;
  font-size: 12.5px;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Responsive adjustments for Copywriting Factory */
@media (max-width: 900px) {
  .cw-main-grid {
    grid-template-columns: 1fr;
  }

  #copywriting-view,
  #brandkit-view,
  #tokopintar-view,
  #marketresearch-view,
  #settings-view {
    padding: 16px;
  }

  .cw-header-banner {
    padding: 18px 16px;
  }

  .tp-chat-simulation-panel {
    height: auto;
    max-height: calc(100vh - 220px);
  }
}

/* ==========================================================================
   ONBOARDING TIP CARD (FASE 2)
   ========================================================================== */
.onboarding-tip-card {
  max-width: 720px;
  width: 100%;
  margin: 24px auto 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--r-2xl);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.3s ease-out;
}

[data-theme="dark"] .onboarding-tip-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(16, 185, 129, 0.12));
  border-color: rgba(59, 130, 246, 0.3);
}

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

.tip-badge {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-700);
}

[data-theme="dark"] .tip-badge {
  color: var(--brand-300);
}

.tip-close-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
  transition: all 0.2s;
}

.tip-close-btn:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.tip-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tip-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-main);
  line-height: 1.4;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-500);
  color: white;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==========================================================================
   BRAND KIT BUILDER STYLES (FASE 3)
   ========================================================================== */
.bk-header-banner {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.09), rgba(168, 85, 247, 0.08));
}

.bk-header-badge {
  color: var(--color-ai-purple);
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.3);
}

[data-theme="dark"] .bk-header-badge {
  color: #c084fc;
}

.bk-btn-generate {
  background: linear-gradient(135deg, #8b5cf6, var(--color-info));
}

.bk-btn-generate:hover {
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.35);
}

.color-swatch-card:hover {
  transform: translateY(-2px);
}

/* ==========================================================================
   TOKO PINTAR AI STYLES (FASE 4)
   ========================================================================== */
.tp-header-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.08));
}

.tp-header-badge {
  color: var(--color-success);
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .tp-header-badge {
  color: #6ee7b7;
}

.tp-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.tp-subnav-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tp-subnav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.tp-subnav-btn.active {
  background: var(--color-success);
  color: white;
  border-color: var(--color-success);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.tp-chat-simulation-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-2xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 580px;
}

.tp-chat-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.tp-chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  color: var(--text-main);
}

.tp-chat-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
}

.tp-cs-chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: var(--bg-app);
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
}

.tp-cs-quick-prompts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tp-quick-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.18s;
}

.tp-quick-btn:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--color-success);
  color: var(--color-success);
}

.tp-cs-composer {
  display: flex;
  gap: 10px;
}

/* ==========================================================================
   RISET PASAR INSTAN STYLES (FASE 5)
   ========================================================================== */
.mr-header-banner {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.08));
}

.mr-header-badge {
  color: var(--color-info);
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .mr-header-badge {
  color: #93c5fd;
}

.mr-btn-generate {
  background: linear-gradient(135deg, #2563eb, var(--color-info));
}

.mr-btn-generate:hover {
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}


/* ==========================================================================
   SETTINGS / INTEGRASI VIEW
   ========================================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.settings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-2xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.settings-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--border-subtle);
}

.settings-card-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.settings-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.settings-card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.settings-status-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--r-full);
  border: 1px solid transparent;
}

.settings-status-unknown {
  color: var(--text-muted);
  background: var(--bg-hover);
  border-color: var(--border-subtle);
}

.settings-status-ok {
  color: var(--brand-500);
  background: rgba(22,163,74,0.1);
  border-color: rgba(22,163,74,0.25);
}

.settings-status-error {
  color: var(--color-danger-strong);
  background: rgba(220,38,38,0.1);
  border-color: rgba(220,38,38,0.25);
}

.settings-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.5;
}

.settings-hint code {
  background: var(--bg-hover);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--brand-600);
}

[data-theme="dark"] .settings-hint code {
  color: var(--brand-400);
}

.settings-show-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.settings-show-btn:hover {
  color: var(--brand-600);
  border-color: var(--brand-500);
}

.settings-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-log {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.settings-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.settings-log-clear {
  background: none;
  border: none;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
}

.settings-log-clear:hover { color: var(--color-danger-strong); }

.settings-log-body {
  padding: 12px 16px;
  max-height: 200px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-line { line-height: 1.5; }
.log-ok    { color: var(--brand-500); }
.log-err   { color: var(--color-danger-strong); }
.log-info  { color: var(--color-info); }

.settings-info-box {
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(59,130,246,0.04));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--r-xl);
  padding: 20px 24px;
}

.settings-info-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 14px;
}

.settings-info-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-info-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
}

.settings-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-indigo), var(--color-info));
  color: white;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}


/* ==========================================================================
   UI/UX ENHANCEMENTS & SKELETON LOADERS
   ========================================================================== */

/* Skeleton Loader Base */
@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-box {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border-subtle) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--r-md);
}

.skeleton-card {
  padding: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.skeleton-line {
  height: 14px;
  border-radius: var(--r-sm);
}

.skeleton-line.w-full { width: 100%; }
.skeleton-line.w-3-4 { width: 75%; }
.skeleton-line.w-1-2 { width: 50%; }
.skeleton-line.w-1-4 { width: 25%; }
.skeleton-line.h-title { height: 20px; }

/* Micro-interaction for Copy Buttons */
.btn-copied {
  background: var(--color-success) !important;
  color: white !important;
  border-color: var(--color-success) !important;
  transform: scale(1.03);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Price Format Helper Preview */
.price-format-preview {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brand-600);
  margin-top: 4px;
  display: inline-block;
  background: var(--brand-50);
  padding: 2px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--brand-200);
}

[data-theme="dark"] .price-format-preview {
  color: var(--brand-400);
  background: rgba(22, 163, 74, 0.15);
  border-color: rgba(22, 163, 74, 0.3);
}

/* Dark Mode Custom Scrollbar */
[data-theme="dark"] ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--bg-app);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 4px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}





/* ═══ PHASE 2 V3.0: DASHBOARD + NAV ICO ═══ */
#dashboard-view { background: var(--bg-app); padding: 28px 32px; overflow-y: auto; }
.dash-wrap { max-width: 920px; margin: 0 auto; width: 100%; }
.dash-hero h1 { font-size: 24px; font-weight: 800; color: var(--text-main); margin: 0 0 6px; }
.dash-hero p { font-size: 14px; color: var(--text-muted); margin: 0 0 22px; }

.dash-active { background: linear-gradient(135deg, rgba(22,163,74,.08), rgba(20,184,166,.06)); border: 1px solid var(--border-subtle); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 22px; }
.dash-active-label { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-subtle); margin-bottom: 8px; }
.dash-active-body { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; width: 100%; }
.dash-active-brand { font-size: 17px; font-weight: 800; color: var(--text-main); }
.dash-active-variant { font-size: 13px; color: var(--text-muted); }
.btn-secondary-sm { background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 7px 14px; font-size: 12.5px; font-weight: 600; color: var(--text-main); cursor: pointer; transition: all .15s; white-space: nowrap; }
.btn-secondary-sm:hover { background: var(--bg-hover); border-color: var(--text-subtle); }

.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 26px; }
.dash-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-lg); padding: 18px; cursor: pointer; transition: all .15s; }
.dash-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.dash-card-icon { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: var(--r-md); }
.dash-card-icon.ic-pen, .dash-activity-icon.ic-pen { color: var(--color-indigo); background: rgba(99,102,241,.12); }
.dash-card-icon.ic-palette, .dash-activity-icon.ic-palette { color: var(--color-ai-pink); background: rgba(236,72,153,.12); }
.dash-card-icon.ic-chart, .dash-activity-icon.ic-chart { color: var(--color-info); background: rgba(59,130,246,.12); }
.dash-card-icon.ic-bot, .dash-activity-icon.ic-bot { color: var(--color-ai-teal); background: rgba(20,184,166,.12); }
.dash-activity-icon.ic-chat { color: var(--brand-bright); background: rgba(22,163,74,.12); }
.dash-card-title { font-size: 14.5px; font-weight: 700; color: var(--text-main); }
.dash-card-desc { font-size: 12.5px; line-height: 1.5; color: var(--text-muted); }

.dash-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-subtle); margin: 0 0 10px; }
.dash-activity-item { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-lg); padding: 12px 14px; margin-bottom: 8px; cursor: pointer; text-align: left; transition: all .15s; }
.dash-activity-item:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.dash-activity-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--r-md); flex-shrink: 0; }
.dash-activity-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-activity-title { font-size: 13.5px; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-activity-preview { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-activity-time { font-size: 11.5px; color: var(--text-subtle); flex-shrink: 0; }
.dash-empty { font-size: 13px; color: var(--text-muted); padding: 14px 0; margin: 0; }

.nav-svg { display: block; }
.model-selector-btn { padding: 4px 10px; font-size: 12px; opacity: .9; }
/* Suggested actions in Chat hub: SVG tints */
.sug-icon.ic-pen, .sug-icon.ic-palette, .sug-icon.ic-chart, .sug-icon.ic-bot, .sug-icon.ic-box, .sug-icon.ic-shield,
.sug-icon.ic-launch { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: var(--r-md); }
.sug-icon.ic-pen { color: var(--color-indigo); background: rgba(99,102,241,.12); }
.sug-icon.ic-palette { color: var(--color-ai-pink); background: rgba(236,72,153,.12); }
.sug-icon.ic-chart { color: var(--color-info); background: rgba(59,130,246,.12); }
.sug-icon.ic-bot { color: var(--color-ai-teal); background: rgba(20,184,166,.12); }
.sug-icon.ic-box { color: var(--brand-bright); background: rgba(22,163,74,.12); }
.sug-icon.ic-shield { color: var(--color-warning); background: rgba(245,158,11,.12); }
.sug-icon.ic-launch { color: var(--color-ai-purple); background: rgba(168,85,247,.12); }
/* ═══ PHASE 5 V3.0: TOKO (PRODUK & KATALOG / AI CS) ═══ */
.tp-subnav-btn { display: inline-flex; align-items: center; gap: 6px; }
.tp-count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--bg-hover); color: var(--text-muted); font-size: 11.5px; font-weight: 800; }
.tp-subnav-btn.active .tp-count-pill { background: rgba(22,163,74,.18); color: var(--brand-bright); }

.tp-chat-simulation-panel { display: flex; flex-direction: column; gap: 12px; }
.tp-cs-status-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.tp-cs-stat { display: flex; align-items: center; gap: 10px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-lg); padding: 12px 14px; }
.tp-cs-stat svg { color: var(--text-subtle); flex-shrink: 0; }
.tp-cs-stat-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-subtle); }
.tp-cs-stat-value { font-size: 13px; font-weight: 700; color: var(--text-main); }
.status-dot-green { background: var(--color-success); border-radius: 50%; display: inline-block; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.tp-cs-publish-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 2px; }
.tp-cs-publish-bar .btn-secondary-action { display: inline-flex; align-items: center; gap: 6px; }
.tp-cs-pub-note { font-size: 11.5px; color: var(--text-subtle); }
/* ═══ PHASE 6 V3.0: SETTINGS (UMUM / INTEGRASI) ═══ */
.settings-subnav { display: flex; gap: 8px; padding: 16px 20px 0; max-width: 480px; margin: 0 auto; }
.settings-subnav-btn { padding: 8px 18px; border-radius: 99px; border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-muted); font-size: 13px; font-weight: 700; cursor: pointer; transition: all .15s; }
.settings-subnav-btn:hover { border-color: var(--border-strong); color: var(--text-main); }
.settings-subnav-btn.active { background: var(--bg-app); border-color: var(--brand-500); color: var(--text-main); box-shadow: var(--focus-ring); }
.settings-umum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; padding: 20px 0; max-width: 1100px; margin: 0 auto; }
/* ═══ PHASE V3.0 §39: DASHBOARD ONBOARDING (first-run) ═══ */
.dash-onboard-card { position: relative; display: flex; flex-wrap: wrap; gap: 18px 26px; align-items: center; background: linear-gradient(135deg, rgba(99,102,241,.09), rgba(16,185,129,.09)); border: 1px solid var(--border-subtle); border-radius: 16px; padding: 20px 22px; margin-bottom: 20px; }
.dash-ob-head { flex: 1 1 260px; min-width: 220px; }
.dash-ob-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--color-ai-teal, #14b8a6); margin-bottom: 6px; }
.dash-ob-title { margin: 0 0 4px; font-size: 16px; font-weight: 800; color: var(--text-main, #111827); }
.dash-ob-desc { margin: 0; font-size: 13px; color: var(--text-muted, #6b7280); }
.dash-ob-steps { display: flex; flex-direction: column; gap: 10px; flex: 2 1 300px; }
.dash-ob-step { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-main, #111827); }
.dash-ob-step svg { flex: none; opacity: .85; color: var(--color-ai-teal, #14b8a6); }
.dash-ob-step b { font-weight: 700; }
.dash-ob-actions { position: relative; flex: 1 1 200px; display: flex; flex-direction: column; gap: 8px; min-width: 200px; }
.dash-ob-actions .btn-primary-action { width: 100%; justify-content: center; }
.dash-ob-close { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; border: none; background: var(--bg-surface, #fff); color: var(--text-muted, #6b7280); font-size: 16px; line-height: 1; cursor: pointer; box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.08)); }
.dash-ob-close:hover { color: var(--text-main, #111827); }
/* ========= UPLOAD & LAMPIRAN (foto produk, lampiran chat) ========= */
.composer-attach-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px 8px;
  margin-bottom: 6px;
  max-width: 260px;
}
.composer-attach-chip img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.composer-attach-name {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.composer-attach-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.composer-attach-remove:hover { color: var(--danger, #dc2626); background: var(--surface-hover, rgba(0,0,0,.05)); }

.chat-attach-img {
  max-width: 220px;
  max-height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.12);
  display: block;
  margin-bottom: 6px;
}
.user-row .chat-attach-img { border-radius: 10px; }

.product-photo-uploader {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.product-photo-preview {
  width: 92px;
  height: 92px;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  flex-shrink: 0;
}
.product-photo-placeholder {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 4px;
  line-height: 1.4;
}
.product-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-photo-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-secondary-sm {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn-secondary-sm:hover { background: var(--surface-hover, rgba(0,0,0,.05)); border-color: var(--primary, #4f46e5); }

.dash-active-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.dash-product-photo {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  display: none;
  align-items: center;
  justify-content: center;
}
.dash-product-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── FASE 0 · ADVANCED DEVELOPER SETTINGS (dev-gated integration) ── */
.advanced-dev-settings {
  border: 1px solid var(--border-subtle, rgba(148,163,184,0.25));
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  box-shadow: var(--shadow-sm, none);
  margin: 22px 0 0;
  padding: 0 16px 14px;
}
.advanced-dev-settings[open] { padding-bottom: 18px; }
.advanced-dev-settings > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 14px 0;
  color: var(--text-primary, #e2e8f0);
  user-select: none;
}
.advanced-dev-settings > summary::-webkit-details-marker { display: none; }
.advanced-dev-settings > summary::before {
  content: '▸';
  color: #818cf8;
  transition: transform .18s ease;
}
.advanced-dev-settings[open] > summary::before { transform: rotate(90deg); }
.ads-summary-icon { font-size: 18px; }
.ads-summary-title { font-weight: 700; font-size: 14.5px; letter-spacing: .2px; }
.ads-summary-hint { margin-left: auto; font-size: 11.5px; color: var(--text-muted, #94a3b8); }
.ads-warning {
  border: 1px dashed rgba(245,158,11,.45);
  background: rgba(245,158,11,.07);
  color: #fbbf24;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.55;
  margin: 0 0 4px;
}
