        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f4f0fe; color: #333; font-size: 14px; overflow: hidden; }

        /* ===== Layout ===== */
        .app-layout { display: flex; flex-direction: column; height: 100vh; }

        /* ===== Header ===== */
        .header {
            height: 56px; background: linear-gradient(135deg, #1a1135 0%, #2d1b69 50%, #3b1f8e 100%);
            display: flex; align-items: center; justify-content: space-between;
            padding: 0 24px; flex-shrink: 0; z-index: 100;
            box-shadow: 0 2px 12px rgba(26,17,53,0.3);
        }
        .header-left { display: flex; align-items: center; gap: 16px; }
        .header-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
        .header-logo svg { width: 28px; height: 28px; }
        .header-logo-text { font-size: 18px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
        .header-logo-text span { background: linear-gradient(135deg, #a78bfa, #c084fc, #e879f9); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
        .header-divider { width: 1px; height: 28px; background: rgba(255,255,255,0.15); }
        .header-breadcrumb { font-size: 13px; color: rgba(255,255,255,0.55); font-weight: 500; }
        .header-breadcrumb .current { color: rgba(255,255,255,0.9); }

        .header-right { display: flex; align-items: center; gap: 12px; }
        .header-btn {
            background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
            border-radius: 8px; padding: 7px 14px; color: rgba(255,255,255,0.8);
            font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s;
            display: flex; align-items: center; gap: 6px;
        }
        .header-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
        .header-btn svg { width: 15px; height: 15px; fill: currentColor; }
        .header-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255,255,255,0.6); }
        .header-status .dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; }
        .header-avatar {
            width: 32px; height: 32px; border-radius: 8px;
            background: linear-gradient(135deg, #7c3aed, #c084fc);
            display: flex; align-items: center; justify-content: center;
            font-size: 13px; font-weight: 700; color: #fff; cursor: pointer;
        }

        /* ===== Notification & User Dropdown ===== */
        .header-dropdown-wrap { position: relative; }

        /* Bell button */
        .notif-btn {
            background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
            border-radius: 8px; width: 34px; height: 34px; display: flex; align-items: center;
            justify-content: center; cursor: pointer; transition: all 0.2s; position: relative;
        }
        .notif-btn:hover { background: rgba(255,255,255,0.15); }
        .notif-btn svg { width: 16px; height: 16px; fill: rgba(255,255,255,0.85); }
        .notif-badge {
            position: absolute; top: -4px; right: -4px;
            background: #ef4444; color: #fff; font-size: 9px; font-weight: 700;
            width: 16px; height: 16px; border-radius: 50%; display: flex;
            align-items: center; justify-content: center; border: 1.5px solid #1a1135;
        }

        /* Dropdown panel chung */
        .dropdown-panel {
            position: absolute; top: calc(100% + 10px); right: 0;
            background: #fff; border-radius: 14px; z-index: 200;
            box-shadow: 0 8px 32px rgba(26,17,53,0.18), 0 2px 8px rgba(0,0,0,0.08);
            border: 1px solid #e8e0f7;
            opacity: 0; visibility: hidden; transform: translateY(-6px);
            transition: all 0.18s ease; pointer-events: none;
        }
        .dropdown-panel.open {
            opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
        }

        /* Notification panel */
        .notif-panel { width: 340px; }
        .notif-panel-header {
            padding: 14px 16px 10px; display: flex; align-items: center; justify-content: space-between;
            border-bottom: 1px solid #f0ebfa;
        }
        .notif-panel-header h4 { font-size: 13px; font-weight: 700; color: #2d1b69; }
        .notif-mark-all { font-size: 11px; color: #7c3aed; cursor: pointer; font-weight: 600; border: none; background: none; padding: 0; }
        .notif-mark-all:hover { text-decoration: underline; }
        .notif-list { max-height: 320px; overflow-y: auto; }
        .notif-item {
            display: flex; gap: 10px; padding: 11px 16px; border-bottom: 1px solid #f9f7ff;
            cursor: pointer; transition: background 0.15s;
        }
        .notif-item:last-child { border-bottom: none; }
        .notif-item:hover { background: #faf8ff; }
        .notif-item.unread { background: #fdfbff; }
        .notif-icon {
            width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
            display: flex; align-items: center; justify-content: center;
        }
        .notif-icon svg { width: 16px; height: 16px; fill: #fff; }
        .notif-icon.success { background: linear-gradient(135deg, #10b981, #34d399); }
        .notif-icon.warning { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
        .notif-icon.info    { background: linear-gradient(135deg, #7c3aed, #a855f7); }
        .notif-icon.error   { background: linear-gradient(135deg, #ef4444, #f97316); }
        .notif-body { flex: 1; min-width: 0; }
        .notif-title { font-size: 12px; font-weight: 600; color: #2d1b69; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .notif-desc  { font-size: 11px; color: #8b7aad; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
        .notif-time  { font-size: 10px; color: #b8a4d9; margin-top: 3px; }
        .notif-dot   { width: 7px; height: 7px; border-radius: 50%; background: #7c3aed; flex-shrink: 0; margin-top: 4px; }
        .notif-empty { padding: 32px; text-align: center; color: #b8a4d9; font-size: 13px; }

        /* User menu panel */
        .user-panel { width: 220px; padding: 6px 0; }
        .user-panel-info {
            padding: 12px 16px 10px; border-bottom: 1px solid #f0ebfa;
            display: flex; align-items: center; gap: 10px;
        }
        .user-panel-avatar {
            width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
            background: linear-gradient(135deg, #7c3aed, #c084fc);
            display: flex; align-items: center; justify-content: center;
            font-size: 14px; font-weight: 700; color: #fff;
        }
        .user-panel-name  { font-size: 13px; font-weight: 600; color: #2d1b69; }
        .user-panel-role  { font-size: 11px; color: #8b7aad; margin-top: 1px; }
        .user-menu-item {
            display: flex; align-items: center; gap: 10px; padding: 9px 16px;
            font-size: 13px; color: #374151; cursor: pointer; transition: background 0.15s;
            border: none; background: none; width: 100%; text-align: left; text-decoration: none;
        }
        .user-menu-item:hover { background: #faf8ff; color: #6d28d9; }
        .user-menu-item svg { width: 15px; height: 15px; fill: currentColor; flex-shrink: 0; color: #8b7aad; }
        .user-menu-item:hover svg { color: #7c3aed; }
        .user-menu-divider { height: 1px; background: #f0ebfa; margin: 4px 0; }
        .user-menu-item.logout { color: #dc2626; }
        .user-menu-item.logout:hover { background: #fff5f5; color: #b91c1c; }
        .user-menu-item.logout svg { color: #ef4444; }

        /* ===== Body ===== */
        .app-body { display: flex; flex: 1; overflow: hidden; }

        /* ===== Sidebar Navigator ===== */
        .sidebar {
            width: 240px; background: #fff; border-right: 1px solid #e8e0f7;
            display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto;
        }
        .sidebar::-webkit-scrollbar { width: 4px; }
        .sidebar::-webkit-scrollbar-thumb { background: #d4c8f0; border-radius: 4px; }

        .nav-group { padding: 8px 0; }
        .nav-group:first-child { padding-top: 12px; }
        .nav-group-header {
            display: flex; align-items: center; gap: 8px;
            padding: 8px 18px; font-size: 11px; font-weight: 800;
            color: #7c3aed; text-transform: uppercase; letter-spacing: 0.8px;
            cursor: pointer; user-select: none; transition: color 0.2s;
        }
        .nav-group-header:hover { color: #6d28d9; }
        .nav-group-header svg { width: 16px; height: 16px; fill: currentColor; }
        .nav-group-header .chevron { margin-left: auto; width: 14px; height: 14px; transition: transform 0.2s; fill: #b8a4d9; }
        .nav-group.collapsed .chevron { transform: rotate(-90deg); }
        .nav-group.collapsed .nav-group-items { display: none; }

        .nav-group-items { padding: 2px 0; }
        .nav-item {
            display: flex; align-items: center; gap: 10px;
            padding: 9px 18px 9px 44px; cursor: pointer;
            font-size: 13px; font-weight: 500; color: #64587a;
            transition: all 0.15s; position: relative;
        }
        .nav-item:hover { background: #f8f5ff; color: #4a1fb8; }
        .nav-item.active {
            background: linear-gradient(90deg, #f3eeff, #f8f5ff);
            color: #6c3ce0; font-weight: 600;
        }
        .nav-item.active::before {
            content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
            width: 3px; border-radius: 0 3px 3px 0;
            background: linear-gradient(180deg, #7c3aed, #a855f7);
        }
        .nav-item svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
        .nav-item .badge-soon {
            margin-left: auto; font-size: 9px; font-weight: 700;
            background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #78350f;
            padding: 2px 6px; border-radius: 4px; text-transform: uppercase;
        }

        .sidebar-footer {
            margin-top: auto; padding: 14px 18px; border-top: 1px solid #f0ebfa;
            font-size: 11px; color: #b8a4d9; font-weight: 500;
        }

        /* ===== Main Content ===== */
        .main-content { flex: 1; overflow: hidden; display: flex; flex-direction: column; background: #f4f0fe; }

        #module-content {
            flex: 1; overflow-y: auto;
        }

        /* ===== Welcome Screen ===== */
        .welcome-screen {
            flex: 1; display: flex; align-items: center; justify-content: center;
            flex-direction: column; gap: 32px; padding: 40px; overflow-y: auto;
        }
        .welcome-header { text-align: center; }
        .welcome-logo {
            width: 64px; height: 64px; border-radius: 18px;
            background: linear-gradient(135deg, #ede9fe, #fae8ff);
            display: flex; align-items: center; justify-content: center;
            margin: 0 auto 16px; box-shadow: 0 4px 16px rgba(124,58,237,0.15);
        }
        .welcome-logo svg { width: 36px; height: 36px; }
        .welcome-title { font-size: 24px; font-weight: 800; color: #2d1b69; margin-bottom: 8px; }
        .welcome-desc { font-size: 14px; color: #8b7aad; line-height: 1.7; }

        .welcome-cards {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 16px;
            width: 100%;
            max-width: 720px;
        }
        .welcome-card {
            background: #fff; border-radius: 16px; padding: 20px;
            box-shadow: 0 2px 8px rgba(108,60,224,0.07);
            cursor: pointer; transition: all 0.2s;
            border: 1.5px solid #f0ebfa;
            display: flex; align-items: flex-start; gap: 16px;
            position: relative; overflow: hidden;
        }
        .welcome-card:hover {
            border-color: #a78bfa; transform: translateY(-2px);
            box-shadow: 0 10px 28px rgba(108,60,224,0.13);
        }
        .wcard-icon {
            width: 48px; height: 48px; border-radius: 13px; flex-shrink: 0;
            display: flex; align-items: center; justify-content: center;
        }
        .wcard-icon svg { width: 24px; height: 24px; fill: #fff; }
        .wcard-icon--email   { background: linear-gradient(135deg, #6366f1, #818cf8); }
        .wcard-icon--kb      { background: linear-gradient(135deg, #7c3aed, #a855f7); }
        .wcard-icon--social  { background: linear-gradient(135deg, #ec4899, #f472b6); }
        .wcard-icon--support { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }

        .wcard-body { flex: 1; min-width: 0; }
        .wcard-body h4 { font-size: 15px; font-weight: 700; color: #2d1b69; margin-bottom: 6px; }
        .wcard-body p { font-size: 12px; color: #8b7aad; line-height: 1.5; margin-bottom: 10px; }
        .wcard-actions { display: flex; flex-wrap: wrap; gap: 6px; }
        .wcard-tag {
            font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 5px;
            background: #f3eeff; color: #7c3aed;
        }
        .wcard-tag--soon {
            background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e;
        }
        .wcard-arrow {
            width: 28px; height: 28px; border-radius: 8px;
            background: #f3eeff; flex-shrink: 0; margin-top: 2px;
            display: flex; align-items: center; justify-content: center;
            transition: background 0.2s;
        }
        .wcard-arrow svg { width: 14px; height: 14px; fill: #7c3aed; }
        .welcome-card:hover .wcard-arrow { background: #7c3aed; }
        .welcome-card:hover .wcard-arrow svg { fill: #fff; }

        /* ===== Loading ===== */
        .frame-loading {
            display: none; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            background: #f4f0fe; align-items: center; justify-content: center;
            z-index: 10;
        }
        .frame-loading.show { display: flex; }
        .spinner { width: 36px; height: 36px; border: 3px solid #e0d5f5; border-top-color: #7c3aed; border-radius: 50%; animation: spin 0.8s linear infinite; }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* ===== Responsive ===== */
        @media (max-width: 768px) {
            .sidebar { width: 200px; }
            .header-breadcrumb, .header-status { display: none; }
            .welcome-cards { grid-template-columns: 1fr; max-width: 380px; }
        }
        @media (max-width: 576px) {
            .sidebar { display: none; }
        }

        /* ===== Agent Module ===== */
        .agent-type-tab {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 6px 14px; border: 1.5px solid #e8e0f7; border-radius: 20px;
            font-size: 12px; font-weight: 600; color: #5b4d8a; background: #fff;
            cursor: pointer; transition: all 0.15s; white-space: nowrap; font-family: inherit;
        }
        .agent-type-tab svg { width: 13px; height: 13px; fill: currentColor; }
        .agent-type-tab:hover { background: #f3f0ff; border-color: #c4b5fd; }
        .agent-type-tab.active { background: #7c3aed; border-color: #7c3aed; color: #fff; }
