/* ComHub Dashboard — diekstrak dari index.html (tanpa perubahan) */
    @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

    * { margin: 0; padding: 0; box-sizing: border-box; }

    :root {
      --bg-primary: #0a0f1e;
      --bg-secondary: #111827;
      --bg-card: #1a2234;
      --bg-hover: #243049;
      --bg-input: #0f172a;
      --border: #2a3a52;
      --border-light: #374151;
      --text-primary: #f1f5f9;
      --text-secondary: #94a3b8;
      --text-muted: #64748b;
      --accent: #22d3ee;
      --accent-dim: rgba(34, 211, 238, 0.1);
      --green: #22c55e;
      --green-dim: rgba(34, 197, 94, 0.15);
      --yellow: #eab308;
      --red: #ef4444;
      --wa-green: #25d366;
      --wa-dark: #054640;
      --radius: 12px;
      --radius-sm: 8px;
      --shadow: 0 4px 24px rgba(0,0,0,0.3);
    }

    body {
      font-family: 'Inter', -apple-system, sans-serif;
      background: var(--bg-primary);
      color: var(--text-primary);
      height: 100vh;
      overflow: hidden;
    }

    /* ===== LAYOUT ===== */
    .app { display: flex; height: 100vh; }

    /* ===== SIDEBAR ===== */
    .sidebar {
      width: 320px;
      background: var(--bg-secondary);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
    }

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

    .logo {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 16px;
    }

    .logo-icon {
      width: 40px; height: 40px;
      background: linear-gradient(135deg, var(--accent), #8b5cf6);
      border-radius: 10px;
      display: flex; align-items: center; justify-content: center;
      font-size: 20px;
    }

    .logo-text { font-weight: 700; font-size: 18px; }
    .logo-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

    .search-box {
      position: relative;
    }

    .search-box input {
      width: 100%;
      padding: 10px 12px 10px 38px;
      background: var(--bg-input);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text-primary);
      font-size: 13px;
      outline: none;
      transition: border-color 0.2s;
    }

    .search-box input:focus { border-color: var(--accent); }

    .search-box::before {
      content: '🔍';
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      font-size: 14px;
    }

    /* Tabs */
    .sidebar-tabs {
      display: flex;
      padding: 12px 20px 0;
      gap: 4px;
    }

    .tab {
      flex: 1;
      padding: 8px;
      text-align: center;
      font-size: 12px;
      font-weight: 500;
      color: var(--text-muted);
      cursor: pointer;
      border-radius: var(--radius-sm) var(--radius-sm) 0 0;
      border: 1px solid transparent;
      border-bottom: none;
      transition: all 0.2s;
    }

    .tab.active {
      color: var(--accent);
      background: var(--bg-card);
      border-color: var(--border);
    }

    .tab:hover:not(.active) { color: var(--text-secondary); }

    /* Conversation List */
    .conv-list {
      flex: 1;
      overflow-y: auto;
      padding: 0;
    }

    .conv-list::-webkit-scrollbar { width: 4px; }
    .conv-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

    .conv-item {
      display: flex;
      align-items: center;
      padding: 14px 20px;
      cursor: pointer;
      border-bottom: 1px solid var(--border);
      transition: background 0.15s;
      gap: 12px;
    }

    .conv-item:hover { background: var(--bg-hover); }
    .conv-item.active { background: var(--accent-dim); border-left: 3px solid var(--accent); }

    .conv-avatar {
      width: 44px; height: 44px;
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-weight: 600;
      font-size: 16px;
      flex-shrink: 0;
      color: white;
    }

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

    .conv-name {
      font-weight: 600;
      font-size: 13px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

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

    .conv-preview {
      font-size: 12px;
      color: var(--text-secondary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-top: 2px;
    }

    .conv-badge {
      background: var(--wa-green);
      color: white;
      font-size: 10px;
      font-weight: 700;
      padding: 2px 6px;
      border-radius: 10px;
      min-width: 18px;
      text-align: center;
    }

    .conv-tags {
      display: flex;
      gap: 4px;
      margin-top: 4px;
    }

    .conv-tag {
      font-size: 9px;
      padding: 1px 6px;
      border-radius: 4px;
      font-weight: 500;
    }

    .tag-hot { background: rgba(239,68,68,0.15); color: #f87171; }
    .tag-warm { background: rgba(234,179,8,0.15); color: #facc15; }
    .tag-cold { background: rgba(99,102,241,0.15); color: #818cf8; }
    .tag-pending { background: rgba(148,163,184,0.15); color: #94a3b8; }

    /* ===== MAIN CHAT ===== */
    .main {
      flex: 1;
      display: flex;
      flex-direction: column;
      background: var(--bg-primary);
    }

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

    .chat-header-left {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .chat-contact-name { font-weight: 600; font-size: 15px; }

    .chat-contact-phone { font-size: 12px; color: var(--text-muted); }

    .chat-status {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      color: var(--green);
    }

    .status-dot {
      width: 8px; height: 8px;
      border-radius: 50%;
      background: var(--green);
      animation: pulse 2s infinite;
    }

    @keyframes pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.5; }
    }

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

    .btn-icon {
      width: 36px; height: 36px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--bg-card);
      color: var(--text-secondary);
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      font-size: 16px;
      transition: all 0.15s;
    }

    .btn-icon:hover { border-color: var(--accent); color: var(--accent); }

    /* Chat Messages */
    .chat-messages {
      flex: 1;
      overflow-y: auto;
      padding: 24px;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .chat-messages::-webkit-scrollbar { width: 4px; }
    .chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

    .msg-group {
      display: flex;
      flex-direction: column;
      gap: 2px;
      margin-bottom: 12px;
    }

    .msg-group.incoming { align-self: flex-start; max-width: 75%; }
    .msg-group.outgoing { align-self: flex-end; max-width: 75%; }

    .msg-bubble {
      padding: 10px 14px;
      border-radius: 12px;
      font-size: 13px;
      line-height: 1.5;
      word-wrap: break-word;
    }

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

    .msg-group.outgoing .msg-bubble {
      background: var(--wa-dark);
      border-bottom-right-radius: 4px;
    }

    .msg-meta {
      font-size: 10px;
      color: var(--text-muted);
      margin-top: 4px;
      display: flex;
      gap: 8px;
    }

    .msg-group.outgoing .msg-meta { justify-content: flex-end; }

    .msg-status { color: var(--accent); }

    /* System messages */
    .msg-system {
      text-align: center;
      font-size: 11px;
      color: var(--text-muted);
      padding: 8px 16px;
      background: var(--accent-dim);
      border-radius: 20px;
      align-self: center;
    }

    /* Typing indicator */
    .typing-indicator {
      align-self: flex-start;
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 10px 14px;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 12px;
      border-bottom-left-radius: 4px;
    }

    .typing-dot {
      width: 6px; height: 6px;
      border-radius: 50%;
      background: var(--text-muted);
      animation: typing 1.4s infinite;
    }

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

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

    /* Chat Input */
    .chat-input-area {
      padding: 16px 24px;
      border-top: 1px solid var(--border);
      background: var(--bg-secondary);
    }

    .input-row {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .input-row input {
      flex: 1;
      padding: 12px 16px;
      background: var(--bg-input);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      color: var(--text-primary);
      font-size: 13px;
      outline: none;
      transition: border-color 0.2s;
    }

    .input-row input:focus { border-color: var(--accent); }

    .btn-send {
      width: 44px; height: 44px;
      border-radius: var(--radius);
      background: var(--wa-green);
      color: white;
      border: none;
      cursor: pointer;
      font-size: 18px;
      display: flex; align-items: center; justify-content: center;
      transition: all 0.15s;
    }

    .btn-send:hover { background: #20c05c; transform: scale(1.05); }

    .input-quick-actions {
      display: flex;
      gap: 6px;
      margin-top: 8px;
      flex-wrap: wrap;
    }

    .quick-action {
      padding: 4px 12px;
      font-size: 11px;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 20px;
      color: var(--text-secondary);
      cursor: pointer;
      transition: all 0.15s;
    }

    .quick-action:hover { border-color: var(--accent); color: var(--accent); }

    /* ===== RIGHT PANEL ===== */
    .right-panel {
      width: 300px;
      background: var(--bg-secondary);
      border-left: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      overflow-y: auto;
    }

    .panel-section {
      padding: 20px;
      border-bottom: 1px solid var(--border);
    }

    .panel-title {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-muted);
      margin-bottom: 12px;
    }

    .contact-card {
      text-align: center;
    }

    .contact-avatar-lg {
      width: 72px; height: 72px;
      border-radius: 50%;
      margin: 0 auto 12px;
      display: flex; align-items: center; justify-content: center;
      font-weight: 700;
      font-size: 28px;
      color: white;
    }

    .contact-name-lg { font-weight: 700; font-size: 16px; }
    .contact-phone-lg { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

    .contact-details { margin-top: 16px; text-align: left; }

    .detail-row {
      display: flex;
      justify-content: space-between;
      padding: 8px 0;
      border-bottom: 1px solid var(--border);
      font-size: 12px;
    }

    .detail-label { color: var(--text-muted); }
    .detail-value { font-weight: 500; }

    /* Lead Score */
    .lead-score {
      text-align: center;
      padding: 20px;
    }

    .score-circle {
      width: 80px; height: 80px;
      border-radius: 50%;
      margin: 0 auto 12px;
      display: flex; align-items: center; justify-content: center;
      font-weight: 700;
      font-size: 24px;
      position: relative;
    }

    .score-circle.hot { background: rgba(239,68,68,0.15); color: #f87171; border: 3px solid #f87171; }
    .score-circle.warm { background: rgba(234,179,8,0.15); color: #facc15; border: 3px solid #facc15; }
    .score-circle.cold { background: rgba(99,102,241,0.15); color: #818cf8; border: 3px solid #818cf8; }

    .score-label {
      font-size: 12px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.1em;
    }

    .score-label.hot { color: #f87171; }
    .score-label.warm { color: #facc15; }
    .score-label.cold { color: #818cf8; }

    /* AI Suggestion */
    .ai-suggestion {
      background: var(--accent-dim);
      border: 1px solid rgba(34,211,238,0.2);
      border-radius: var(--radius-sm);
      padding: 12px;
      font-size: 12px;
      line-height: 1.5;
      color: var(--text-secondary);
    }

    .ai-suggestion-header {
      display: flex;
      align-items: center;
      gap: 6px;
      font-weight: 600;
      color: var(--accent);
      margin-bottom: 6px;
      font-size: 11px;
    }

    /* Stats bar */
    .stats-bar {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 16px;
      padding: 16px 24px;
      border-bottom: 1px solid var(--border);
      background: var(--bg-secondary);
    }

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

    .stat-value { font-weight: 700; font-size: 20px; }
    .stat-value.green { color: var(--green); }
    .stat-value.accent { color: var(--accent); }
    .stat-value.yellow { color: var(--yellow); }
    .stat-value.red { color: var(--red); }

    .stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

    /* Workflow indicator */
    .workflow-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 10px;
      padding: 3px 8px;
      border-radius: 4px;
      font-weight: 500;
    }

    .wf-parfume { background: rgba(236,72,153,0.15); color: #f472b6; }
    .wf-padel { background: rgba(34,197,94,0.15); color: #4ade80; }
    .wf-seragam { background: rgba(59,130,246,0.15); color: #60a5fa; }
    .wf-campaign { background: rgba(234,179,8,0.15); color: #facc15; }
    .wf-lead { background: rgba(168,85,247,0.15); color: #c084fc; }
    .wf-cart { background: rgba(249,115,22,0.15); color: #fb923c; }
    .wf-order { background: rgba(20,184,166,0.15); color: #2dd4bf; }
    .wf-rag { background: rgba(96,165,250,0.15); color: #93c5fd; }
    .wf-handover { background: rgba(244,63,94,0.15); color: #fb7185; }
    .wf-guard { background: rgba(148,163,184,0.15); color: #cbd5e1; }
    .wf-memory { background: rgba(129,140,248,0.15); color: #a5b4fc; }

    /* Channel badges */
    .channel-badge {
      display: inline-flex; align-items: center; gap: 3px;
      font-size: 9px; padding: 1px 6px; border-radius: 4px; font-weight: 500;
    }
    .ch-whatsapp { background: rgba(37,211,102,0.15); color: #4ade80; }
    .ch-email { background: rgba(59,130,246,0.15); color: #60a5fa; }
    .ch-sms { background: rgba(168,85,247,0.15); color: #c084fc; }

    /* Handover banner */
    .handover-banner {
      background: linear-gradient(90deg, rgba(244,63,94,0.15), rgba(244,63,94,0.05));
      border: 1px solid rgba(244,63,94,0.3);
      border-radius: 8px;
      padding: 8px 12px;
      margin-bottom: 8px;
      font-size: 11px;
      color: #fb7185;
      display: flex; align-items: center; gap: 8px;
    }

    /* Blocked/guardrail message */
    .msg-guardrail {
      background: rgba(239,68,68,0.1) !important;
      border: 1px solid rgba(239,68,68,0.3) !important;
    }

    /* Cart recovery indicator */
    .cart-indicator {
      display: flex; align-items: center; gap: 6px;
      font-size: 10px; color: #fb923c;
      padding: 4px 8px;
      background: rgba(249,115,22,0.1);
      border-radius: 4px;
    }

    /* Empty state */
    .empty-state {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      color: var(--text-muted);
    }

    .empty-icon { font-size: 48px; margin-bottom: 16px; }
    .empty-text { font-size: 14px; }

    /* Scrollbar global */
    .right-panel::-webkit-scrollbar { width: 4px; }
    .right-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

    /* Login overlay (tampil bila AUTH_REQUIRED=true) */
    .login-overlay {
      position: fixed; inset: 0; z-index: 9999;
      background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(4px);
      display: flex; align-items: center; justify-content: center;
    }
    .login-card {
      background: #fff; border-radius: 16px; padding: 32px;
      width: 320px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    }
    .login-logo { font-size: 40px; }
    .login-card h2 { margin: 8px 0 4px; color: #0f172a; }
    .login-sub { margin: 0 0 20px; color: #64748b; font-size: 13px; }
    .login-card input {
      width: 100%; padding: 10px 12px; margin-bottom: 10px;
      border: 1px solid #e2e8f0; border-radius: 8px; font-size: 14px; box-sizing: border-box;
    }
    .login-card button {
      width: 100%; padding: 10px; border: none; border-radius: 8px;
      background: #22c55e; color: #fff; font-weight: 600; cursor: pointer; font-size: 14px;
    }
    .login-card button:hover { background: #16a34a; }
    .login-error { color: #ef4444; font-size: 12px; margin-top: 8px; min-height: 16px; }

    /* Animations */
    .fade-in { animation: fadeIn 0.2s ease-out; }

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