    /* ==========================================================================
       CSS Variables & Reset - Modern WhatsApp Business CRM
       ========================================================================== */
    :root {
      /* Brand Luxury Emerald & Lotus Gold (VNLASHES Official) */
      --brand-emerald-dark: #071f1a;
      --brand-emerald: #09231f;
      --brand-emerald-surface: #0e352f;
      --brand-emerald-accent: #059669;
      --brand-emerald-light: #10b981;
      --brand-gold: #d4af37;
      --brand-gold-light: #fef3c7;
      --brand-gold-text: #b45309;
      --brand-gold-primary: #d4af37;
      --brand-gold-light: #fef3c7;

      /* Neutral Base (90-95% Neutral as per Taste Skill) */
      --bg-canvas: #f8fafc;
      --bg-surface: #ffffff;
      --bg-surface-subtle: #f1f5f9;
      --bg-surface-hover: #f8fafc;
      --border-color: #e2e8f0;
      --border-light: #f1f5f9;
      --border-muted: #cbd5e1;
      --border-focus: #059669;

      /* Ink / High-Contrast Typography */
      --text-primary: #0f172a;
      --text-secondary: #475569;
      --text-muted: #94a3b8;

      /* Chat Bubble Semantics */
      --customer-bubble-bg: #ffffff;
      --staff-bubble-bg: #ecfdf5;
      --translation-bg: #f8fafc;
      --translation-border: #059669;
      --translation-text: #065f46;
      --chat-bg: #f8fafc;

      /* Legacy compatibility mappings */
      --brand-green: #059669;
      --brand-green-dark: #047857;
      --brand-green-header: #09231f;
      --brand-green-light: #10b981;
      --brand-green-subtle: #f0fdf4;
      --brand-blue: #0284c7;
      --brand-blue-dark: #0369a1;

      /* Radius & Shadows (Taste Skill Anti-Slop) */
      --radius-sm: 6px;
      --radius-md: 10px;
      --radius-lg: 14px;
      --radius-pill: 9999px;

      --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
      --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
      --shadow-card-hover: 0 4px 12px -2px rgba(9, 35, 31, 0.07), 0 2px 4px -1px rgba(9, 35, 31, 0.04);
      --shadow-bubble: 0 1px 3px 0 rgba(15, 23, 42, 0.05);

      /* Motion Tokens (Taste Skill motion.md) */
      --m-in: 140ms;
      --m-out: 200ms;
      --m-press: 90ms;
      --m-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    /* --------------------------------------------------------------------------
       Dashboard markup compatibility
       The dashboard HTML intentionally uses product-facing class names. Keep
       these layout aliases beside the design system so a stylesheet refactor
       cannot silently fall back to browser-default controls.
       -------------------------------------------------------------------------- */
    .header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
    .header-right { display: flex; align-items: center; gap: 12px; }
    .logo-box {
      width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
      flex: 0 0 40px; display: flex; align-items: center; justify-content: center;
      background: rgba(255,255,255,.08);
      box-shadow: 0 0 0 1.5px rgba(212,175,55,.4), 0 3px 8px rgba(0,0,0,.35);
    }
    .app-title { font-size: 1.05rem; font-weight: 700; line-height: 1.2; letter-spacing: -.015em; color: #fff; }
    .app-subtitle { font-size: .72rem; color: rgba(255,255,255,.68); margin-top: 2px; }
    .accounts-bar { display: flex; align-items: center; gap: 8px; min-width: 0; }
    .accounts-tabs { display: flex; align-items: center; gap: 6px; overflow-x: auto; max-width: 520px; }
    .btn-add-account, .btn-more-options {
      min-height: 32px; padding: 6px 11px; border-radius: 8px; cursor: pointer;
      font: inherit; font-size: .76rem; font-weight: 600;
    }
    .btn-add-account { color: var(--brand-gold-light); background: rgba(212,175,55,.13); border: 1px solid rgba(212,175,55,.58); }
    .btn-more-options { color: #fff; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); display: inline-flex; align-items: center; gap: 5px; }
    .user-profile-pill { display: flex; align-items: center; gap: 7px; color: #fff; font-size: .78rem; }
    .user-role-badge { border: 1px solid rgba(212,175,55,.6); color: var(--brand-gold-light); border-radius: 4px; padding: 2px 5px; font-size: .64rem; font-weight: 700; }
    .btn-logout { border: 1px solid rgba(255,255,255,.18); border-radius: 6px; padding: 4px 8px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; font: inherit; font-size: .72rem; }
    .dropdown-wrapper { position: relative; }
    .options-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 80; min-width: 220px; padding: 6px; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius-md); box-shadow: var(--shadow-md); display: none; }
    .options-menu.is-open, .dropdown-wrapper.is-open .options-menu { display: block; }
    .options-menu-item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text-primary); cursor: pointer; text-align: left; font: inherit; font-size: .78rem; }
    .options-menu-item:hover { background: var(--bg-surface-subtle); }
    .crm-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr) auto; height: calc(100vh - 58px); min-height: 0; background: var(--bg-surface); overflow: hidden; position: relative; }
    .sidebar-header { padding: 12px 14px; background: var(--bg-surface); border-bottom: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 10px; }
    .search-box { display: flex; align-items: center; gap: 8px; padding: 7px 11px; background: var(--bg-surface-subtle); border: 1px solid var(--border-muted); border-radius: var(--radius-sm); }
    .search-box:focus-within { background: #fff; border-color: var(--brand-emerald-accent); box-shadow: 0 0 0 3px rgba(5,150,105,.12); }
    .search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: .82rem; }
    .clear-search-btn { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; }
    .country-filter-wrap { display: flex; }
    .country-select { width: 100%; padding: 6px 9px; border: 1px solid var(--border-muted); border-radius: var(--radius-sm); background: #fff; color: var(--text-primary); font: inherit; font-size: .78rem; }
    .customer-drawer { min-width: 280px; width: 320px; background: #fff; border-left: 1px solid var(--border-color); display: flex; flex-direction: column; min-height: 0; }
    .reply-section { background: #fff; padding: 10px 20px; border-top: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; z-index: 10; }
    .reply-input-wrapper { display: flex; flex-direction: column; gap: 8px; }
    .reply-textarea { width: 100%; min-height: 58px; resize: vertical; border: 1px solid var(--border-muted); border-radius: var(--radius-md); padding: 10px 12px; font: inherit; font-size: .84rem; color: var(--text-primary); outline: none; }
    .reply-textarea:focus { border-color: var(--brand-emerald-accent); box-shadow: 0 0 0 3px rgba(5,150,105,.12); }
    .reply-action-buttons { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
    .btn-reply-tool, .btn-reply-send-translate, .btn-reply-send {
      min-height: 36px; padding: 8px 13px; border-radius: 8px; cursor: pointer;
      display: inline-flex; align-items: center; justify-content: center; gap: 6px;
      font: inherit; font-size: .78rem; font-weight: 600;
      transition: transform var(--m-in) var(--m-ease), box-shadow var(--m-in) var(--m-ease), background var(--m-in) var(--m-ease);
    }
    .btn-reply-tool { color: var(--text-secondary); background: #fff; border: 1px solid var(--border-muted); }
    .btn-reply-send-translate { color: #065f46; background: #ecfdf5; border: 1px solid #a7f3d0; }
    .btn-reply-send { color: #fff; background: var(--brand-emerald-accent); border: 1px solid var(--brand-emerald-accent); }
    .btn-reply-tool:hover, .btn-reply-send-translate:hover, .btn-reply-send:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
    .btn-reply-tool:active, .btn-reply-send-translate:active, .btn-reply-send:active { transform: translateY(1px) scale(.98); }
    .translation-preview-box { padding: 10px 12px; border: 1px solid #bbf7d0; border-radius: var(--radius-md); background: #f0fdf4; }
    .preview-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
    .preview-title { display: inline-flex; align-items: center; gap: 5px; color: #065f46; font-size: .76rem; font-weight: 700; }
    .preview-content { color: var(--text-primary); font-size: .84rem; line-height: 1.45; white-space: pre-wrap; }
    .btn-close-preview, .btn-close-drawer, .btn-copy-phone {
      border: 0; background: transparent; color: var(--text-muted); cursor: pointer;
      display: inline-flex; align-items: center; justify-content: center; border-radius: 6px;
    }
    .btn-close-preview { width: 28px; height: 28px; font-size: 1.2rem; }
    .btn-close-drawer, .btn-copy-phone { width: 30px; height: 30px; }
    .btn-close-preview:hover, .btn-close-drawer:hover, .btn-copy-phone:hover { color: var(--text-primary); background: var(--bg-surface-subtle); }
    .drawer-title { color: var(--text-primary); font-size: .9rem; font-weight: 700; }
    .drawer-profile { padding: 18px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; border-bottom: 1px solid var(--border-light); }
    .drawer-avatar-img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; display: block; }
    .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-emerald-light); }
    .tab-unreplied-dot { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; display: inline-block; }
    .search-icon { color: var(--text-muted); flex: 0 0 auto; }
    .options-menu-divider { height: 1px; margin: 5px 4px; background: var(--border-light); }
    .user-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
    .admin-only { visibility: visible; }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }

    body {
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11', 'tnum';
      background-color: var(--bg-canvas);
      color: var(--text-primary);
      height: 100vh;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    /* SVG Icon Helpers */
    .svg-icon {
      display: inline-block;
      vertical-align: middle;
      flex-shrink: 0;
    }

    /* ==========================================================================
       App Header (VNLASHES Luxury Dark Emerald & Gold Lotus)
       ========================================================================== */
    .app-header {
      background: var(--brand-emerald);
      color: #ffffff;
      padding: 0 20px;
      height: 58px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid rgba(212, 175, 55, 0.22);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
      z-index: 30;
      flex-shrink: 0;
    }

    .brand-section {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .brand-icon-box {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(255, 255, 255, 0.08);
      overflow: hidden;
      box-shadow: 0 0 0 1.5px rgba(212, 175, 55, 0.4), 0 3px 8px rgba(0, 0, 0, 0.35);
      transition: transform var(--m-in) var(--m-ease);
    }

    .brand-icon-box:hover {
      transform: scale(1.04);
    }

    .brand-logo-img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 50%;
      display: block;
    }

    .brand-title h1 {
      font-size: 1.05rem;
      font-weight: 700;
      letter-spacing: -0.015em;
      line-height: 1.2;
      color: #ffffff;
    }

    .brand-title p {
      font-size: 0.72rem;
      color: rgba(255, 255, 255, 0.68);
      font-weight: 400;
      letter-spacing: 0.01em;
    }

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

    .whatsapp-connect-btn {
      min-height: 36px;
      padding: 0 13px;
      border-radius: 8px;
      border: 1px solid rgba(212, 175, 55, 0.58);
      background: rgba(212, 175, 55, 0.13);
      color: #fef3c7;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font: inherit;
      font-size: 0.76rem;
      font-weight: 600;
      cursor: pointer;
      transition: transform var(--m-in) var(--m-ease), background var(--m-in) var(--m-ease), border-color var(--m-in) var(--m-ease);
    }

    .whatsapp-connect-btn:hover {
      background: rgba(212, 175, 55, 0.22);
      border-color: rgba(212, 175, 55, 0.82);
      transform: translateY(-1px);
    }

    .whatsapp-connect-btn:active {
      transform: translateY(1px) scale(0.98);
    }

    .whatsapp-connect-btn[data-state="CONNECTED"] {
      color: #d1fae5;
      background: rgba(16, 185, 129, 0.13);
      border-color: rgba(16, 185, 129, 0.48);
    }

    .whatsapp-state-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--brand-gold);
      box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
      flex-shrink: 0;
    }

    .whatsapp-connect-btn[data-state="CONNECTED"] .whatsapp-state-dot {
      background: var(--brand-emerald-light);
      box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    }

    .whatsapp-connect-btn[data-state="CONNECTING"] .whatsapp-state-dot {
      animation: pulse 1.4s infinite;
    }

    .whatsapp-modal-backdrop {
      position: fixed;
      inset: 0;
      z-index: 10000;
      background: rgba(7, 31, 26, 0.72);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 24px;
    }

    .whatsapp-modal-backdrop.is-open {
      display: flex;
    }

    .whatsapp-modal {
      width: min(880px, 100%);
      max-height: min(720px, calc(100vh - 48px));
      overflow: auto;
      background: #ffffff;
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      box-shadow: 0 24px 70px rgba(7, 31, 26, 0.34);
    }

    .whatsapp-modal-header {
      min-height: 68px;
      padding: 16px 20px;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
    }

    .whatsapp-modal-title h2 {
      color: var(--brand-emerald-dark);
      font-size: 1.05rem;
      line-height: 1.35;
      letter-spacing: -0.015em;
    }

    .whatsapp-modal-title p {
      margin-top: 3px;
      color: var(--text-secondary);
      font-size: 0.78rem;
      line-height: 1.4;
    }

    .whatsapp-modal-close {
      width: 36px;
      height: 36px;
      border: 1px solid var(--border-color);
      border-radius: 8px;
      background: #ffffff;
      color: var(--text-secondary);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: transform var(--m-in) var(--m-ease), background var(--m-in) var(--m-ease);
    }

    .whatsapp-modal-close:hover {
      background: var(--bg-surface-subtle);
      transform: translateY(-1px);
    }

    .whatsapp-modal-body {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 360px;
      gap: 32px;
      padding: 28px;
    }

    .whatsapp-steps {
      display: flex;
      flex-direction: column;
      gap: 18px;
    }

    .whatsapp-step {
      display: grid;
      grid-template-columns: 32px minmax(0, 1fr);
      gap: 12px;
      align-items: start;
    }

    .whatsapp-step-number {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: var(--brand-gold-light);
      color: var(--brand-gold-text);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.78rem;
      font-weight: 700;
    }

    .whatsapp-step strong {
      display: block;
      color: var(--text-primary);
      font-size: 0.86rem;
      line-height: 1.4;
    }

    .whatsapp-step p {
      margin-top: 4px;
      color: var(--text-secondary);
      font-size: 0.8rem;
      line-height: 1.55;
    }

    .whatsapp-phone-note {
      margin-top: 4px;
      padding: 12px 14px;
      border-left: 3px solid var(--brand-emerald-accent);
      background: #f0fdf4;
      color: #065f46;
      border-radius: 0 8px 8px 0;
      font-size: 0.78rem;
      line-height: 1.5;
    }

    .whatsapp-qr-panel {
      min-height: 390px;
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      background: var(--bg-surface-subtle);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 14px;
      padding: 18px;
      text-align: center;
    }

    .whatsapp-qr-image {
      width: min(100%, 320px);
      aspect-ratio: 1;
      display: none;
      background: #ffffff;
      border-radius: 8px;
    }

    .whatsapp-qr-placeholder {
      width: min(100%, 320px);
      aspect-ratio: 1;
      border: 1px dashed #cbd5e1;
      border-radius: 8px;
      background: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 28px;
      color: var(--text-secondary);
      font-size: 0.82rem;
      line-height: 1.5;
    }

    .whatsapp-qr-status {
      color: var(--text-secondary);
      font-size: 0.78rem;
      line-height: 1.45;
    }

    .whatsapp-disconnect-btn {
      min-height: 40px;
      padding: 0 16px;
      border: 1px solid #fecaca;
      border-radius: 8px;
      background: #ffffff;
      color: #b91c1c;
      font: inherit;
      font-size: 0.78rem;
      font-weight: 600;
      cursor: pointer;
      display: none;
    }

    .whatsapp-disconnect-btn:hover {
      background: #fef2f2;
    }

    .account-selector-box {
      display: flex;
      align-items: center;
      gap: 6px;
      background: rgba(255, 255, 255, 0.07);
      border: 1px solid rgba(255, 255, 255, 0.12);
      padding: 5px 10px;
      border-radius: 8px;
      backdrop-filter: blur(6px);
      transition: border-color var(--m-in) var(--m-ease);
    }

    .account-selector-box:focus-within {
      border-color: rgba(212, 175, 55, 0.5);
    }

    .account-selector-box label {
      font-size: 0.75rem;
      color: rgba(255, 255, 255, 0.75);
      font-weight: 500;
      white-space: nowrap;
    }

    .account-select {
      background: transparent;
      color: #ffffff;
      border: none;
      font-size: 0.78rem;
      font-weight: 600;
      outline: none;
      cursor: pointer;
      max-width: 200px;
    }

    .account-select option {
      background: #ffffff;
      color: var(--text-primary);
    }

    .live-badge {
      display: flex;
      align-items: center;
      gap: 6px;
      background: rgba(255, 255, 255, 0.07);
      border: 1px solid rgba(255, 255, 255, 0.12);
      padding: 4px 11px;
      border-radius: var(--radius-pill);
      font-size: 0.72rem;
      font-weight: 600;
      letter-spacing: 0.02em;
      backdrop-filter: blur(6px);
    }

    .live-dot {
      width: 7px;
      height: 7px;
      background-color: var(--brand-emerald-light);
      border-radius: 50%;
      animation: pulse 1.8s infinite;
    }

    @keyframes pulse {
      0% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.4; transform: scale(1.2); }
      100% { opacity: 1; transform: scale(1); }
    }

    .stats-pill {
      font-size: 0.75rem;
      color: rgba(255, 255, 255, 0.95);
      background: rgba(255, 255, 255, 0.07);
      border: 1px solid rgba(255, 255, 255, 0.12);
      padding: 5px 12px;
      border-radius: var(--radius-pill);
      display: flex;
      align-items: center;
      gap: 8px;
      backdrop-filter: blur(6px);
    }

    .header-icon-btn {
      background: rgba(255, 255, 255, 0.07);
      border: 1px solid rgba(255, 255, 255, 0.12);
      color: #ffffff;
      width: 32px;
      height: 32px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      backdrop-filter: blur(6px);
      transition: all var(--m-in) var(--m-ease);
    }

    .header-icon-btn:hover {
      background: rgba(255, 255, 255, 0.15);
      border-color: rgba(255, 255, 255, 0.22);
      transform: translateY(-1px);
    }

    .header-icon-btn:active {
      transform: translateY(1px) scale(0.98);
    }

    /* ==========================================================================
       Main Layout (3 Panes: Sidebar, Chat, Profile Drawer)
       ========================================================================== */
    .app-main {
      display: grid;
      grid-template-columns: 360px 1fr auto;
      height: calc(100vh - 58px);
      min-height: 0;
      background: var(--bg-surface);
      overflow: hidden;
      position: relative;
    }

    /* ==========================================================================
       Left Sidebar: Conversations List
       ========================================================================== */
    aside.sidebar {
      background-color: var(--bg-surface);
      border-right: 1px solid var(--border-color);
      display: flex;
      flex-direction: column;
      height: 100%;
      min-height: 0;
      z-index: 10;
    }

    .sidebar-search-area {
      padding: 12px 14px;
      background: var(--bg-surface);
      border-bottom: 1px solid var(--border-color);
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .search-input-box {
      display: flex;
      align-items: center;
      background: var(--bg-surface-subtle);
      border-radius: var(--radius-sm);
      padding: 7px 11px;
      gap: 8px;
      border: 1px solid var(--border-muted);
      transition: all var(--m-in) var(--m-ease);
    }

    .search-input-box:focus-within {
      background: #ffffff;
      border-color: var(--brand-emerald-accent);
      box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
    }

    .search-input-box svg {
      color: var(--text-muted);
    }

    .search-input-box input {
      border: none;
      outline: none;
      width: 100%;
      font-size: 0.82rem;
      color: var(--text-primary);
      background: transparent;
      font-family: inherit;
    }

    .search-clear-btn {
      background: transparent;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      padding: 2px;
      display: none;
      align-items: center;
      justify-content: center;
      transition: color var(--m-in) var(--m-ease);
    }
    .search-clear-btn:hover {
      color: var(--text-primary);
    }

    .filter-controls-row {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .country-filter-select {
      flex: 1;
      background: var(--bg-surface);
      border: 1px solid var(--border-muted);
      border-radius: var(--radius-sm);
      padding: 6px 9px;
      font-size: 0.78rem;
      color: var(--text-primary);
      outline: none;
      cursor: pointer;
      font-weight: 500;
      font-family: inherit;
      transition: all var(--m-in) var(--m-ease);
    }
    .country-filter-select:focus {
      border-color: var(--brand-emerald-accent);
      box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
    }

    .filter-tabs {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }

    .filter-tab {
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      padding: 5px 11px;
      border-radius: var(--radius-pill);
      font-size: 0.74rem;
      cursor: pointer;
      color: var(--text-secondary);
      transition: all var(--m-in) var(--m-ease);
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-weight: 500;
      user-select: none;
    }

    .filter-tab:hover {
      border-color: var(--border-muted);
      color: var(--text-primary);
      transform: translateY(-1px);
    }

    .filter-tab:active {
      transform: translateY(1px) scale(0.98);
    }

    .filter-tab.active {
      background: var(--brand-emerald);
      color: #ffffff;
      border-color: var(--brand-emerald);
      transform: none;
      box-shadow: 0 1px 2px rgba(9, 35, 31, 0.15);
    }

    .filter-tab.active .badge-count {
      background: #ffffff;
      color: var(--brand-emerald);
    }

    .dot-unreplied {
      width: 8px;
      height: 8px;
      background-color: #ef4444;
      border-radius: 50%;
      display: inline-block;
      margin-right: 2px;
    }

    .dot-unreplied-badge {
      width: 6px;
      height: 6px;
      background-color: #ef4444;
      border-radius: 50%;
      display: inline-block;
      margin-right: 3px;
    }

    .badge-count {
      background: #ef4444;
      color: #ffffff;
      font-size: 0.65rem;
      padding: 1px 6px;
      border-radius: 10px;
      font-weight: 700;
      font-feature-settings: 'tnum';
    }

    .conversations-list {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      overflow-x: hidden;
      scrollbar-width: thin;
      scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    }

    .conversations-list::-webkit-scrollbar {
      width: 5px;
    }
    .conversations-list::-webkit-scrollbar-thumb {
      background: rgba(0, 0, 0, 0.15);
      border-radius: 3px;
    }

    /* Conversation Card - Taste Skill Quiet Micro-Interactions */
    .conversation-card {
      display: flex;
      align-items: center;
      padding: 12px 14px;
      gap: 12px;
      cursor: pointer;
      background-color: var(--bg-surface);
      border-bottom: 1px solid var(--border-light);
      border-left: 3.5px solid transparent;
      transition: all var(--m-in) var(--m-ease);
      position: relative;
    }

    .conversation-card:hover {
      background-color: var(--bg-surface-hover);
      transform: translateY(-1.5px);
      box-shadow: var(--shadow-card-hover);
      z-index: 2;
    }

    .conversation-card.active {
      background-color: #f0fdf4;
      border-left-color: var(--brand-emerald-accent);
      transform: none;
      box-shadow: none;
      z-index: 1;
    }

        .customer-avatar-img {
      width: 100%;
      height: 100%;
      border-radius: 50%;
      object-fit: cover;
      display: block;
      user-select: none;
    }

    .avatar-circle, .chat-header-avatar, .message-avatar-small, .drawer-avatar {
      overflow: hidden;
      padding: 0;
    }

    .drawer-avatar-wrap {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
    }

    .btn-change-avatar {
      background: var(--bg-surface-subtle);
      border: 1px solid var(--border-muted);
      border-radius: var(--radius-pill);
      padding: 3px 11px;
      font-size: 0.68rem;
      font-weight: 600;
      color: var(--text-secondary);
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 4px;
      transition: all var(--m-in) var(--m-ease);
      font-family: inherit;
    }

    .btn-change-avatar:hover {
      background: var(--border-color);
      color: var(--text-primary);
      transform: translateY(-1px);
    }
    .btn-change-avatar:active {
      transform: translateY(1px) scale(0.98);
    }

    .canned-chips-list {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .canned-chip-item {
      display: inline-flex;
      align-items: center;
      background: #ffffff;
      border: 1px solid var(--border-muted);
      border-radius: var(--radius-pill);
      overflow: hidden;
      transition: all var(--m-in) var(--m-ease);
    }

    .canned-chip-item:hover {
      border-color: #94a3b8;
      transform: translateY(-1px);
      box-shadow: var(--shadow-sm);
    }

    .canned-chip-item .canned-chip {
      background: transparent;
      border: none;
      color: var(--text-primary);
      padding: 4px 9px;
      font-size: 0.74rem;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
    }

    .canned-chip-item .btn-chip-del {
      background: transparent;
      border: none;
      border-left: 1px solid var(--border-color);
      color: var(--text-muted);
      padding: 4px 7px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all var(--m-in) var(--m-ease);
    }

    .canned-chip-item .btn-chip-del:hover {
      color: #ef4444;
      background-color: #fee2e2;
    }

    .canned-cmd-hint {
      font-size: 0.68rem;
      color: var(--text-muted);
      white-space: nowrap;
      margin-left: 4px;
      padding: 2px 7px;
      background: rgba(15, 23, 42, 0.04);
      border-radius: var(--radius-sm);
    }

    .canned-cmd-hint code {
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-weight: 600;
      color: var(--text-secondary);
    }

    .avatar-circle {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      background: linear-gradient(135deg, #0284c7, #0369a1);
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.95rem;
      font-weight: 600;
      flex-shrink: 0;
      position: relative;
      user-select: none;
      box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
      transition: transform var(--m-in) var(--m-ease);
    }

    .conversation-card:hover .avatar-circle {
      transform: scale(1.02);
    }

    .unreplied-indicator {
      position: absolute;
      top: 0;
      right: 0;
      width: 12px;
      height: 12px;
      background: #ef4444;
      border: 2px solid #ffffff;
      border-radius: 50%;
      box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2);
      animation: pulse 2s infinite;
    }

    .card-info {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

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

    .customer-phone {
      font-size: 0.86rem;
      font-weight: 600;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      display: flex;
      align-items: center;
      gap: 4px;
      font-feature-settings: 'tnum';
    }

    .card-time {
      font-size: 0.68rem;
      color: var(--text-muted);
      flex-shrink: 0;
      margin-left: 6px;
      font-feature-settings: 'tnum';
    }

    .card-meta-line {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      margin-top: 1px;
    }

    .card-country-tag {
      font-size: 0.7rem;
      color: #0284c7;
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .status-badge {
      font-size: 0.65rem;
      padding: 1px 6px;
      border-radius: 4px;
      font-weight: 600;
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      gap: 3px;
    }
    .status-unreplied {
      background: #fee2e2;
      color: #b91c1c;
      border: 1px solid #fca5a5;
    }
    .status-replied {
      background: #ecfdf5;
      color: #047857;
      border: 1px solid #a7f3d0;
    }

    .card-snippet {
      font-size: 0.77rem;
      color: var(--text-secondary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      display: flex;
      align-items: center;
      gap: 5px;
      margin-top: 2px;
    }

    .card-snippet.unread {
      font-weight: 600;
      color: var(--text-primary);
    }

    .direction-badge {
      font-size: 0.62rem;
      padding: 1px 5px;
      border-radius: 4px;
      font-weight: 600;
      flex-shrink: 0;
    }
    .badge-inbound {
      background-color: #dbeafe;
      color: #1e40af;
    }
    .badge-outbound {
      background-color: #dcfce7;
      color: #15803d;
    }

    /* ==========================================================================
       Center Pane: Active Chat Room
       ========================================================================== */
    main.chat-section {
      background-color: var(--chat-bg);
      display: flex;
      flex-direction: column;
      height: 100%;
      min-height: 0;
      position: relative;
      overflow: hidden;
    }

    /* Chat Header */
    .chat-header {
      background-color: #ffffff;
      padding: 10px 20px;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      align-items: center;
      justify-content: space-between;
      z-index: 10;
      flex-shrink: 0;
      box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    }

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

    .chat-header-avatar {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: linear-gradient(135deg, #0284c7, #0369a1);
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
      user-select: none;
    }

    .chat-header-info h2 {
      font-size: 0.95rem;
      font-weight: 600;
      color: var(--text-primary);
      display: flex;
      align-items: center;
      gap: 8px;
      letter-spacing: -0.01em;
      font-feature-settings: 'tnum';
    }

    .chat-header-info p {
      font-size: 0.72rem;
      color: var(--text-muted);
      margin-top: 2px;
      display: flex;
      align-items: center;
      gap: 4px;
    }

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

    .btn-header-tool {
      background: var(--bg-surface-subtle);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-sm);
      padding: 6px 12px;
      cursor: pointer;
      transition: all var(--m-in) var(--m-ease);
      font-size: 0.76rem;
      font-weight: 500;
      display: flex;
      align-items: center;
      gap: 5px;
      color: var(--text-secondary);
      font-family: inherit;
    }

    .btn-header-tool:hover {
      background: #ffffff;
      border-color: var(--border-muted);
      color: var(--text-primary);
      transform: translateY(-1px);
    }
    .btn-header-tool:active {
      transform: translateY(1px) scale(0.98);
    }

    /* Chat Messages Body */
    .chat-body {
      flex: 1;
      min-height: 0;
      padding: 18px 24px;
      overflow-y: auto;
      overflow-x: hidden;
      display: flex;
      flex-direction: column;
      gap: 8px;
      scrollbar-width: thin;
      scrollbar-color: rgba(15, 23, 42, 0.15) transparent;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
      background-color: #f8fafc;
      background-image: radial-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px);
      background-size: 20px 20px;
    }

    .chat-body::-webkit-scrollbar {
      width: 6px;
    }
    .chat-body::-webkit-scrollbar-thumb {
      background: rgba(15, 23, 42, 0.14);
      border-radius: 3px;
    }

    /* Date Separator Pill */
    .date-separator {
      display: flex;
      justify-content: center;
      margin: 14px 0 8px 0;
      user-select: none;
    }

    .date-separator-pill {
      background: rgba(255, 255, 255, 0.92);
      border: 1px solid rgba(226, 232, 240, 0.85);
      color: var(--text-secondary);
      font-size: 0.7rem;
      font-weight: 600;
      padding: 4px 14px;
      border-radius: var(--radius-pill);
      box-shadow: var(--shadow-sm);
      backdrop-filter: blur(6px);
      font-feature-settings: 'tnum';
    }

    /* Message Rows & Bubbles */
    .message-row {
      display: flex;
      width: 100%;
      align-items: flex-end;
      gap: 8px;
      position: relative;
    }

    .message-row.inbound {
      justify-content: flex-start;
    }

    .message-row.outbound {
      justify-content: flex-end;
    }

    .message-avatar-small {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: linear-gradient(135deg, #0284c7, #0369a1);
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      margin-bottom: 2px;
      user-select: none;
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    }

    .message-bubble {
      max-width: 68%;
      min-width: 170px;
      padding: 9px 13px;
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-bubble);
      position: relative;
      display: flex;
      flex-direction: column;
      gap: 5px;
      transition: box-shadow var(--m-in) var(--m-ease);
    }

    .message-row:hover .btn-copy-bubble {
      opacity: 1;
    }

    .message-row.inbound .message-bubble {
      background-color: var(--customer-bubble-bg);
      border-top-left-radius: 4px;
      border: 1px solid rgba(226, 232, 240, 0.9);
    }

    .message-row.outbound .message-bubble {
      background-color: var(--staff-bubble-bg);
      border-top-right-radius: 4px;
      border: 1px solid rgba(5, 150, 105, 0.2);
    }

    .btn-copy-bubble {
      position: absolute;
      top: -10px;
      right: 8px;
      background: #ffffff;
      border: 1px solid #cbd5e1;
      color: var(--text-secondary);
      width: 22px;
      height: 22px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      opacity: 0;
      transition: all var(--m-in) var(--m-ease);
      box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
    }

    .btn-copy-bubble:hover {
      color: var(--text-primary);
      transform: scale(1.1);
    }

    .bubble-content-original {
      font-size: 0.88rem;
      line-height: 1.5;
      color: var(--text-primary);
      word-break: break-word;
      white-space: pre-wrap;
    }

    .bubble-content-translation {
      background-color: #f8fafc;
      border: 1px solid #e2e8f0;
      border-left: 3px solid var(--brand-emerald-accent);
      border-radius: 6px;
      padding: 7px 11px;
      margin-top: 3px;
      font-size: 0.84rem;
      line-height: 1.45;
      color: var(--brand-emerald-dark);
      word-break: break-word;
      display: flex;
      align-items: flex-start;
      gap: 6px;
    }

    .translation-icon {
      color: var(--brand-emerald-accent);
      display: inline-flex;
      align-items: center;
      margin-top: 2px;
      flex-shrink: 0;
    }

    .translation-text {
      flex: 1;
    }

    .bubble-footer {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 4px;
      margin-top: 2px;
    }

    .bubble-time {
      font-size: 0.65rem;
      color: var(--text-muted);
      line-height: 1;
      font-feature-settings: 'tnum';
    }

    /* Scroll to Bottom Button */
    .scroll-bottom-btn {
      position: absolute;
      right: 24px;
      bottom: 120px;
      width: 36px;
      height: 36px;
      background: #ffffff;
      border: 1px solid var(--border-color);
      border-radius: 50%;
      display: none;
      align-items: center;
      justify-content: center;
      box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
      cursor: pointer;
      color: var(--text-secondary);
      transition: all var(--m-in) var(--m-ease);
      z-index: 20;
    }

    .scroll-bottom-btn:hover {
      background: #f8fafc;
      transform: translateY(-2px);
      box-shadow: 0 5px 12px rgba(15, 23, 42, 0.18);
    }

    /* ==========================================================================
       Chat Footer: Canned Replies, AI Assist & Direct WhatsApp Sender
       ========================================================================== */
    .chat-footer {
      background: #ffffff;
      padding: 10px 20px;
      border-top: 1px solid var(--border-color);
      display: flex;
      flex-direction: column;
      gap: 8px;
      flex-shrink: 0;
      z-index: 10;
      box-shadow: 0 -1px 3px rgba(15, 23, 42, 0.02);
    }

    /* Quick Reply Chips Bar */
    .canned-replies-bar {
      display: flex;
      align-items: center;
      gap: 6px;
      overflow-x: auto;
      padding-bottom: 3px;
      scrollbar-width: none;
    }
    .canned-replies-bar::-webkit-scrollbar {
      display: none;
    }

    .canned-label {
      font-size: 0.72rem;
      font-weight: 600;
      color: var(--text-secondary);
      white-space: nowrap;
      display: flex;
      align-items: center;
      gap: 4px;
      margin-right: 2px;
    }

    .canned-chip {
      background: #ffffff;
      border: 1px solid var(--border-muted);
      color: var(--text-secondary);
      padding: 4px 10px;
      border-radius: var(--radius-pill);
      font-size: 0.74rem;
      font-weight: 500;
      cursor: pointer;
      white-space: nowrap;
      transition: all var(--m-in) var(--m-ease);
      font-family: inherit;
    }

    .canned-chip:hover {
      background: var(--bg-surface-subtle);
      color: var(--text-primary);
      border-color: #94a3b8;
      transform: translateY(-1px);
    }

    /* AI Preview Box */
    .ai-preview-box {
      background: #f0fdf4;
      border: 1px solid #bbf7d0;
      border-radius: var(--radius-md);
      padding: 10px 14px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      animation: fadeIn 0.2s ease;
    }

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

    .ai-preview-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .ai-preview-title {
      font-size: 0.76rem;
      font-weight: 700;
      color: var(--brand-emerald-dark);
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .ai-preview-close {
      background: transparent;
      border: none;
      font-size: 1.1rem;
      color: var(--text-muted);
      cursor: pointer;
      line-height: 1;
      transition: color var(--m-in) var(--m-ease);
    }
    .ai-preview-close:hover {
      color: var(--text-primary);
    }

    .ai-preview-content {
      font-size: 0.86rem;
      color: var(--text-primary);
      line-height: 1.45;
      background: #ffffff;
      padding: 8px 12px;
      border-radius: var(--radius-sm);
      border: 1px solid #bbf7d0;
    }

    .ai-preview-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .btn-use-preview {
      background: var(--brand-emerald-accent);
      color: #ffffff;
      border: none;
      padding: 5px 12px;
      border-radius: var(--radius-sm);
      font-size: 0.74rem;
      font-weight: 600;
      cursor: pointer;
      transition: all var(--m-in) var(--m-ease);
    }
    .btn-use-preview:hover {
      background: #047857;
      transform: translateY(-1px);
    }
    .btn-use-preview:active {
      transform: translateY(1px) scale(0.98);
    }

    .ai-preview-hint {
      font-size: 0.68rem;
      color: var(--text-muted);
    }

    /* Input Row */
    .chat-input-wrapper {
      display: flex;
      gap: 8px;
      align-items: flex-end;
    }

    .chat-textarea {
      flex: 1;
      background: #ffffff;
      border: 1px solid var(--border-muted);
      border-radius: var(--radius-md);
      padding: 10px 14px;
      font-size: 0.88rem;
      line-height: 1.45;
      color: var(--text-primary);
      outline: none;
      resize: none;
      font-family: inherit;
      min-height: 44px;
      max-height: 130px;
      transition: all var(--m-in) var(--m-ease);
    }

    .chat-textarea:focus {
      border-color: var(--brand-emerald-accent);
      box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
    }

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

    .btn-action-ai {
      background: #ffffff;
      border: 1px solid var(--border-muted);
      color: var(--brand-emerald-accent);
      padding: 9px 12px;
      border-radius: 8px;
      font-size: 0.78rem;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 5px;
      white-space: nowrap;
      height: 44px;
      transition: all var(--m-in) var(--m-ease);
      font-family: inherit;
    }
    .btn-action-ai:hover {
      background: #f0fdf4;
      border-color: #a7f3d0;
      transform: translateY(-1px);
    }
    .btn-action-ai:active {
      transform: translateY(1px) scale(0.98);
    }

    .btn-translate-send {
      background: #0284c7;
      color: #ffffff;
      border: none;
      padding: 9px 14px;
      border-radius: 8px;
      font-size: 0.82rem;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
      height: 44px;
      transition: all var(--m-in) var(--m-ease);
      font-family: inherit;
      box-shadow: 0 1px 2px rgba(2, 132, 199, 0.2);
    }
    .btn-translate-send:hover {
      background: #0369a1;
      transform: translateY(-1px);
      box-shadow: 0 3px 6px rgba(2, 132, 199, 0.25);
    }
    .btn-translate-send:active {
      transform: translateY(1px) scale(0.98);
    }

    .btn-send-whatsapp {
      background: var(--brand-emerald-accent);
      color: #ffffff;
      border: none;
      padding: 9px 18px;
      border-radius: 8px;
      font-size: 0.82rem;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
      height: 44px;
      transition: all var(--m-in) var(--m-ease);
      font-family: inherit;
      box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2);
    }
    .btn-send-whatsapp:hover {
      background: #047857;
      transform: translateY(-1px);
      box-shadow: 0 3px 6px rgba(5, 150, 105, 0.25);
    }
    .btn-send-whatsapp:active {
      transform: translateY(1px) scale(0.98);
    }

    .btn-send-whatsapp:disabled, .btn-action-ai:disabled, .btn-translate-send:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none !important;
      box-shadow: none !important;
    }

    .chat-status-bar {
      font-size: 0.74rem;
      padding: 4px 10px;
      border-radius: 4px;
      display: none;
    }
    .chat-status-bar.info {
      background: #e0f2fe;
      color: #0369a1;
      display: block;
    }
    .chat-status-bar.success {
      background: #dcfce7;
      color: #15803d;
      display: block;
    }
    .chat-status-bar.error {
      background: #fee2e2;
      color: #b91c1c;
      display: block;
    }

    /* ==========================================================================
       Right Column: Collapsible Customer Profile Drawer
       ========================================================================== */
    aside.customer-drawer {
      width: 290px;
      background: var(--bg-surface);
      border-left: 1px solid var(--border-color);
      display: flex;
      flex-direction: column;
      height: 100%;
      min-height: 0;
      transition: width var(--m-out) var(--m-ease), opacity var(--m-in) var(--m-ease), border-left var(--m-out) var(--m-ease);
      overflow-y: auto;
      overflow-x: hidden;
      z-index: 15;
    }

    aside.customer-drawer.collapsed {
      width: 0;
      border-left: none;
      opacity: 0;
      pointer-events: none;
    }

    .drawer-header {
      padding: 14px 18px;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: var(--bg-surface);
      flex-shrink: 0;
    }

    .drawer-header h3 {
      font-size: 0.84rem;
      font-weight: 600;
      letter-spacing: -0.01em;
      color: var(--text-primary);
    }

    .btn-drawer-close {
      background: transparent;
      border: 1px solid transparent;
      border-radius: var(--radius-sm);
      color: var(--text-muted);
      cursor: pointer;
      width: 26px;
      height: 26px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all var(--m-in) var(--m-ease);
    }
    .btn-drawer-close:hover {
      background: var(--bg-surface-subtle);
      border-color: var(--border-color);
      color: var(--text-primary);
      transform: translateY(-1px);
    }
    .btn-drawer-close:active {
      transform: translateY(1px) scale(0.96);
    }

    .drawer-body {
      padding: 18px 16px;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .drawer-profile-box {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      padding-bottom: 16px;
      border-bottom: 1px solid var(--border-color);
      gap: 10px;
    }

    .drawer-avatar {
      width: 68px;
      height: 68px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--brand-emerald-dark), var(--brand-emerald));
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.35), 0 4px 12px rgba(9, 35, 31, 0.12);
      overflow: hidden;
      transition: transform var(--m-in) var(--m-ease);
    }
    .drawer-avatar:hover {
      transform: scale(1.03);
    }
    .drawer-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 50%;
      display: block;
    }

    .drawer-phone-row {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .drawer-phone {
      font-size: 0.95rem;
      font-weight: 700;
      color: var(--text-primary);
      letter-spacing: -0.01em;
      font-feature-settings: 'tnum';
    }

    .btn-copy-sm {
      background: var(--bg-surface-subtle);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-sm);
      width: 24px;
      height: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-secondary);
      cursor: pointer;
      transition: all var(--m-in) var(--m-ease);
    }
    .btn-copy-sm:hover {
      background: #ffffff;
      color: var(--brand-emerald-accent);
      border-color: var(--brand-emerald-accent);
      transform: translateY(-1px);
      box-shadow: var(--shadow-sm);
    }
    .btn-copy-sm:active {
      transform: translateY(1px) scale(0.96);
    }

    .drawer-status-pill {
      font-size: 0.7rem;
      font-weight: 600;
      padding: 3px 9px;
      border-radius: var(--radius-pill);
      letter-spacing: 0.01em;
    }

    .drawer-section {
      display: flex;
      flex-direction: column;
      gap: 10px;
      background: var(--bg-surface-subtle);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 12px 14px;
    }

    .drawer-field {
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .drawer-field-label {
      font-size: 0.68rem;
      color: var(--text-muted);
      font-weight: 600;
      letter-spacing: 0.03em;
      text-transform: uppercase;
    }

    .drawer-field-val {
      font-size: 0.82rem;
      color: var(--text-primary);
      font-weight: 600;
      font-feature-settings: 'tnum';
    }

    .notes-section {
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 12px 14px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .notes-header {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 0.74rem;
      font-weight: 600;
      color: var(--text-primary);
    }

    .notes-header svg {
      color: var(--brand-emerald-accent);
    }

    .notes-textarea {
      width: 100%;
      background: var(--bg-surface-subtle);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-sm);
      padding: 8px 10px;
      font-size: 0.78rem;
      font-family: inherit;
      color: var(--text-primary);
      outline: none;
      resize: vertical;
      line-height: 1.45;
      transition: all var(--m-in) var(--m-ease);
    }
    .notes-textarea:focus {
      background: #ffffff;
      border-color: var(--brand-emerald-accent);
      box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
    }

    .notes-footer {
      display: flex;
      justify-content: flex-end;
      margin-top: 2px;
    }

    .notes-status {
      font-size: 0.65rem;
      color: var(--text-muted);
      font-weight: 500;
    }

    /* ==========================================================================
       Empty State & Toast Notifications
       ========================================================================== */
    .empty-state {
      margin: auto;
      text-align: center;
      padding: 40px 24px;
      max-width: 400px;
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    .empty-icon-box {
      width: 64px;
      height: 64px;
      background: #ffffff;
      border: 1px solid var(--border-color);
      border-radius: 50%;
      margin: 0 auto 16px auto;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 4px 12px rgba(9, 35, 31, 0.06);
      transition: transform var(--m-in) var(--m-ease);
    }
    .empty-icon-box:hover {
      transform: scale(1.05);
    }

    .empty-state h3 {
      font-size: 1rem;
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 8px;
      letter-spacing: -0.015em;
    }

    .empty-state p {
      font-size: 0.82rem;
      color: var(--text-secondary);
      line-height: 1.5;
    }

    /* Toast Container */
    .toast-container {
      position: fixed;
      top: 68px;
      right: 20px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      z-index: 9999;
      pointer-events: none;
    }

    .toast-item {
      pointer-events: auto;
      background: #ffffff;
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 10px 14px;
      display: flex;
      align-items: center;
      gap: 10px;
      box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
      font-size: 0.8rem;
      color: var(--text-primary);
      max-width: 360px;
      animation: slideInRight var(--m-out) var(--m-ease);
      transition: opacity var(--m-out) var(--m-ease), transform var(--m-out) var(--m-ease);
    }

    @keyframes slideInRight {
      from { transform: translateX(30px); opacity: 0; }
      to { transform: translateX(0); opacity: 1; }
    }

    .toast-item.toast-fade-out {
      opacity: 0;
      transform: translateX(30px);
    }

    .toast-icon {
      flex-shrink: 0;
      display: flex;
      align-items: center;
    }

    .toast-item.toast-success .toast-icon { color: #16a34a; }
    .toast-item.toast-error .toast-icon { color: #dc2626; }
    .toast-item.toast-warning .toast-icon { color: #ea580c; }
    .toast-item.toast-info .toast-icon { color: #2563eb; }

    /* Responsive */
    @media (max-width: 1080px) {
      aside.customer-drawer {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        box-shadow: -4px 0 12px rgba(0,0,0,0.1);
      }
    }

    @media (max-width: 768px) {
      .account-selector-box {
        display: none;
      }
      .whatsapp-connect-label {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .whatsapp-modal-backdrop {
        padding: 12px;
      }
      .whatsapp-modal {
        max-height: calc(100vh - 24px);
      }
      .whatsapp-modal-body {
        grid-template-columns: 1fr;
        padding: 20px;
      }
      .whatsapp-qr-panel {
        min-height: 360px;
        order: -1;
      }
      .app-main, .crm-layout {
        grid-template-columns: 1fr;
      }
      aside.sidebar {
        display: none;
      }
      aside.sidebar.mobile-open {
        display: flex;
        position: absolute;
        inset: 0;
        width: 100%;
        z-index: 50;
      }
      .header-left > div:not(.logo-box) { display: none; }
      .accounts-bar { display: none; }
      .header-right { margin-left: auto; }
    }

    /* Account Tabs & Multi-Account Switcher */
    .account-tabs-bar {
      display: flex;
      align-items: center;
      gap: 6px;
      overflow-x: auto;
      max-width: 520px;
      padding: 2px 0;
      scrollbar-width: none;
    }
    .account-tabs-bar::-webkit-scrollbar { display: none; }
    .account-tab-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      border-radius: 8px;
      border: 1px solid rgba(255, 255, 255, 0.16);
      background: rgba(255, 255, 255, 0.06);
      color: #ffffff;
      font-size: 0.76rem;
      font-weight: 600;
      cursor: pointer;
      white-space: nowrap;
      transition: all var(--m-in) var(--m-ease);
    }
    .account-tab-btn:hover {
      background: rgba(255, 255, 255, 0.12);
      border-color: rgba(212, 175, 55, 0.4);
    }
    .account-tab-btn.active {
      background: rgba(212, 175, 55, 0.16);
      border-color: var(--brand-gold-primary);
      color: var(--brand-gold-light);
      box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
    }
    .account-state-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #94a3b8;
    }
    .account-state-dot.online { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.6); }
    .account-state-dot.qr { background: #eab308; box-shadow: 0 0 6px rgba(234, 179, 8, 0.6); }
    .account-state-dot.offline { background: #ef4444; }
    .account-add-btn {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 6px 10px;
      border-radius: 8px;
      border: 1px dashed rgba(212, 175, 55, 0.5);
      background: transparent;
      color: var(--brand-gold-light);
      font-size: 0.74rem;
      font-weight: 600;
      cursor: pointer;
      white-space: nowrap;
      transition: all var(--m-in) var(--m-ease);
    }
    .account-add-btn:hover {
      background: rgba(212, 175, 55, 0.1);
      border-color: var(--brand-gold-primary);
    }

    /* User Profile Header */
    .user-profile-box {
      display: flex;
      align-items: center;
      gap: 8px;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.14);
      border-radius: 8px;
      padding: 4px 10px;
    }
    .user-role-badge {
      font-size: 0.65rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      padding: 2px 6px;
      border-radius: 4px;
    }
    .user-role-admin {
      background: rgba(212, 175, 55, 0.2);
      color: var(--brand-gold-light);
      border: 1px solid rgba(212, 175, 55, 0.4);
    }
    .user-role-staff {
      background: rgba(16, 185, 129, 0.2);
      color: #6ee7b7;
      border: 1px solid rgba(16, 185, 129, 0.4);
    }
    .user-action-btn {
      background: transparent;
      border: none;
      color: rgba(255, 255, 255, 0.7);
      font-size: 0.74rem;
      font-weight: 500;
      cursor: pointer;
      padding: 3px 6px;
      border-radius: 4px;
      transition: color var(--m-in) var(--m-ease);
    }
    .user-action-btn:hover {
      color: #ffffff;
      background: rgba(255, 255, 255, 0.12);
    }

    /* Auth & Users Modals */
    .auth-modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(5, 18, 16, 0.88);
      backdrop-filter: blur(8px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      padding: 20px;
    }
    .auth-modal-backdrop.is-open {
      display: flex;
    }
    .auth-modal-card {
      background: #09231f;
      border: 1px solid rgba(212, 175, 55, 0.35);
      box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 30px rgba(212, 175, 55, 0.12);
      border-radius: 14px;
      width: 100%;
      max-width: 400px;
      padding: 32px 28px;
      color: #ffffff;
      display: flex;
      flex-direction: column;
      gap: 18px;
    }
    .auth-modal-title {
      text-align: center;
    }
    .auth-modal-title h2 {
      font-size: 1.25rem;
      color: var(--brand-gold-primary);
      margin: 0 0 6px 0;
      font-weight: 700;
    }
    .auth-modal-title p {
      font-size: 0.8rem;
      color: rgba(255, 255, 255, 0.65);
      margin: 0;
    }
    .auth-input-group {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .auth-input-group label {
      font-size: 0.74rem;
      color: rgba(255, 255, 255, 0.8);
      font-weight: 600;
    }
    .auth-input {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: 8px;
      padding: 10px 14px;
      color: #ffffff;
      font-size: 0.85rem;
      outline: none;
      transition: all var(--m-in) var(--m-ease);
    }
    .auth-input:focus {
      border-color: var(--brand-gold-primary);
      box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
      background: rgba(255, 255, 255, 0.12);
    }
    .auth-submit-btn {
      background: linear-gradient(135deg, #d4af37, #b89326);
      color: #09231f;
      border: none;
      border-radius: 8px;
      padding: 11px;
      font-size: 0.88rem;
      font-weight: 700;
      cursor: pointer;
      box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
      transition: all var(--m-in) var(--m-ease);
    }
    .auth-submit-btn:hover {
      filter: brightness(1.1);
      transform: translateY(-1px);
    }
    .auth-error-msg {
      background: rgba(239, 68, 68, 0.15);
      border: 1px solid rgba(239, 68, 68, 0.3);
      border-radius: 8px;
      padding: 8px 12px;
      color: #fca5a5;
      font-size: 0.78rem;
      display: none;
    }

    /* Staff Management Modal */
    .users-modal-card {
      background: #09231f;
      border: 1px solid rgba(212, 175, 55, 0.35);
      box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
      border-radius: 14px;
      width: 100%;
      max-width: 640px;
      padding: 28px;
      color: #ffffff;
      display: flex;
      flex-direction: column;
      gap: 18px;
      max-height: 90vh;
      overflow-y: auto;
    }
    .users-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.8rem;
    }
    .users-table th, .users-table td {
      padding: 8px 10px;
      text-align: left;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .users-table th {
      color: var(--brand-gold-primary);
      font-weight: 600;
      text-transform: uppercase;
      font-size: 0.7rem;
    }

/* ==========================================================================
   Production Workflow Additions: Status, Assignee, Attachments
   ========================================================================== */
.status-select, .assignee-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--brand-gold-primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}
.status-select:hover, .assignee-select:hover {
  border-color: var(--brand-gold-primary);
  background: rgba(255, 255, 255, 0.12);
}
.status-select option, .assignee-select option {
  background: #071f1a;
  color: #fff;
}
.attachment-card {
  margin-top: 8px;
  display: block;
}
.attachment-img-preview {
  max-width: 260px;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: block;
  transition: transform 0.2s ease;
  cursor: pointer;
}
.attachment-img-preview:hover {
  transform: scale(1.02);
}
.attachment-doc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: var(--brand-gold-light);
  font-size: 0.78rem;
  text-decoration: none;
  transition: all 0.2s ease;
}
.attachment-doc-pill:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--brand-gold-primary);
}
    .dropdown-wrapper {
      position: relative;
    }

    .options-menu {
      display: none;
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      z-index: 120;
      min-width: 240px;
      padding: 8px;
      border: 1px solid var(--border-light);
      border-radius: 10px;
      background: var(--surface-card);
      box-shadow: var(--shadow-lg);
    }

    .options-menu.is-open {
      display: block;
    }

    .options-menu-item {
      display: flex;
      width: 100%;
      align-items: center;
      gap: 8px;
      padding: 9px 10px;
      border: 0;
      border-radius: 7px;
      background: transparent;
      color: var(--text-primary);
      cursor: pointer;
    }
